• Randall Leeds's avatar
    Clean up filter, updater, and store interactions · 4919b16b
    Randall Leeds authored
    Rather than having the annotator service handle the API service
    discovery event, handle it in the app controller. That allows for
    all the calls to add the Store plugin to be centralized in this
    controller.
    
    The `reloadAnnotations` function is modified so as not to assume
    that a Store is already loaded, cleaning up only if one is. The
    new store is placed on the scope so that its entities can be watched.
    
    Rather than racing with the store, the updater is configured with
    a new filter when the entities change. When the stream route is loaded,
    these entities are empty, but the configured stream filter is sent
    without re-initializing the filter. The stream search controller only
    has to send a new filter if an updater is already open, otherwise it
    is opened when the store is configured.
    
    The patched `Store.loadAnnotations` is changed so that it creates a
    fresh entities object on each invocation. This change ensures that if
    provider frame disconnection is handled at some point the entities will
    not continue to be included in searches and it makes the scope watcher
    for this property very cheap.
    
    Fixes #1306
    4919b16b
streamsearch.coffee 1.86 KB