fix: compose internal lifecycle hooks in attachWorkspaceStoreLifecycle#11
Merged
ryanjosebrosas merged 4 commits intoa7u-pr-finalfrom Mar 26, 2026
Merged
fix: compose internal lifecycle hooks in attachWorkspaceStoreLifecycle#11ryanjosebrosas merged 4 commits intoa7u-pr-finalfrom
ryanjosebrosas merged 4 commits intoa7u-pr-finalfrom
Conversation
4 tasks
Co-authored-by: ryanjosebrosas <178813774+ryanjosebrosas@users.noreply.github.com> Agent-Logs-Url: https://github.com/ryanjosebrosas/secondbrain-engine/sessions/4ac570fd-fc8a-4e60-8f93-743d2817dd06
Copilot
AI
changed the title
[WIP] [WIP] Address feedback on hardening app-boundary workspace auth for a7u
fix: compose internal lifecycle hooks in attachWorkspaceStoreLifecycle
Mar 26, 2026
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR fixes attachWorkspaceStoreLifecycle so it composes (rather than overwrites) internal.initialize/internal.close, ensuring internal lifecycle hooks aren’t silently dropped when lifecycle-enabled workspace stores are present.
Changes:
- Add
hasStoreInitialize/hasStoreClosechecks to decide when to synthesize lifecycle functions. - Compose
initializeto callinternal.initializefirst, then initialize lifecycle stores in order. - Compose
closeto close lifecycle stores in reverse order, then callinternal.closelast.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Owner
|
@copilot apply changes based on the comments in this thread |
Author
Both suggestions from that review have been applied:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
attachWorkspaceStoreLifecyclewas overwritinginternal.initialize/internal.closewith hooks derived solely fromlifecycleStores, silently dropping any hooks already oninternal(e.g.,pg.Poolclose from a default Postgres workspace store).Changes
initialize: callsinternal.initialize?.()first (only when the active workspace store matches the internal store, to avoid triggering unused Postgres initialization with override stores), then initializes each lifecycle store in orderclose: closes lifecycle stores in reverse inside individualtry/catchblocks, then always callsinternal.close?.()in afinallyblock — ensuring internal teardown (e.g., connection pool cleanup) is never skipped even if a store close fails; multiple errors are aggregated viaAggregateError💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.