You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Repeated non-CORS filter blocking overwrites the original disabled state #574
In Diva 7.5.2, setFilterAccessBlocked(true) overwrites each control's saved disabled state on every call. A second blocked call saves the already-forced disabled = true state. Unblocking then leaves previously enabled filter controls and Save view disabled.
Reported by request of @ahankinson while reviewing the vendored Diva update in Cantus. This issue belongs upstream, outside the scope of the Cantus OMR highlighting changes.
Affected area
src/diva.ts, method setFilterAccessBlocked, including both the .diva-modal-sidebar controls and the Save view button.
applyFilterPreview calls this method when the filter source changes. closeFilterPreview also calls it to restore access.
Reproduction
Use Page View with static images loaded without CORS.
Move between two non-CORS static pages so that setFilterAccessBlocked(true) runs twice on the same controls.
Switch to a CORS-enabled page, or close the filter preview so that setFilterAccessBlocked(false) runs.
Check whether controls that were originally enabled remain disabled.
The state overwrite follows directly from the vendored implementation. The browser reproduction has not been run.
Required change
Save the original disabled state only when dataset.divaFilterWasDisabled is undefined. Apply this guard to both the sidebar controls and the Save view button. Continue forcing controls to disabled while blocked. On unblocking, restore the saved state and remove the saved marker.
Acceptance criteria
Repeated blocked calls preserve the original disabled state.
Unblocking restores originally enabled controls to enabled.
Originally disabled controls remain disabled.
Save view follows the same rules.
Regression coverage includes repeated blocking followed by unblocking.
Activity