8000 AsyncCache does not invalidate cache, if invalidate is called from inside fetch · Issue #896 · dart-lang/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
AsyncCache does not invalidate cache, if invalidate is called from inside fetch #896
Open
@aanelson

Description

@aanelson

Steps to reproduce

    final cache = AsyncCache<void>(const Duration(seconds: 1));
    Future<void> function() async {
      debugPrint('called function');
      cache.invalidate();
    }

    await cache.fetch(function);
    await cache.fetch(function);
    await cache.fetch(function);

Expected results

It should clear results. It would print 'called function' three times.

At the very least the documentation should mention this behavior.

Actual results

It caches based on the timer. In the above code it would print a single 'called function'.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0