Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

[Scope] Issue with scope.unwatch() not working #787

Closed
@vicb

Description

@vicb

Consider the following TC:

      iit(r'should be possible to remove every watch',
          (RootScope rootScope, FilterMap filters) {
        rootScope.context['foo'] = 'bar';
        var watch1 = rootScope.watch('(foo|json)+"bar"', (v, p) => null,
        filters: filters);
        var watch2 = rootScope.watch('(foo|json)+"bar"', (v, p) => null,
        filters: filters);

        expect(() => watch1.remove()).not.toThrow();
        expect(() => watch2.remove()).not.toThrow();
      });

expect(() => watch2.remove()).not.toThrow(); would throw with Test failed: Caught 'package:angular/change_detection/watch_group.dart': Failed assertion: line 826 pos 12: 'mode != _MODE_DELETED_' is not true.

As we are watching the same expression twice, removing it once removes both. Note: it is not an issue with simple expressions like foo only

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions