fix(dashboard): preserve store this-binding in merge-advance-events endpoint
The route was extracting getRunAuditEvents off scopedStore and calling it as a bare function, which made this.db.prepare(...) throw. useMergeAdvanceNotice silently swallowed the error, so the banner never rendered after merges. Call the method on the store reference instead so this is preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
9
.changeset/merge-advance-notice-render-fix.md
Normal file
9
.changeset/merge-advance-notice-render-fix.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
"@fusion/dashboard": patch
|
||||
---
|
||||
|
||||
fix(dashboard): unbreak Merge Advance Notice banner by preserving store `this` binding in events endpoint
|
||||
|
||||
`GET /api/tasks/merge-advance-events` was extracting `getRunAuditEvents` off the scoped store as a bare function reference and calling it without `this`, which made `this.db.prepare(...)` throw "Cannot read properties of undefined (reading 'db')" on every request. The `useMergeAdvanceNotice` hook caught the failure silently (`catch { setEvents([]) }`), so the banner never appeared even after the merger advanced the integration branch ref.
|
||||
|
||||
Fix: keep the store reference and call `storeWithRunAudit.getRunAuditEvents(...)` as a method so `this` is preserved, matching the pattern used by other routes that read run-audit events.
|
||||
Reference in New Issue
Block a user