fix: resolve merge conflict with a7u-pr-final and harden lifecycle close hook#12
Conversation
…arison Co-authored-by: ryanjosebrosas <178813774+ryanjosebrosas@users.noreply.github.com> Agent-Logs-Url: https://github.com/ryanjosebrosas/secondbrain-engine/sessions/96e7c129-faab-406a-936d-36136e898821
|
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
Fixes two correctness/security issues in the runtime: workspace-store lifecycle hooks are now composed (so overrides don’t drop internal init/close), and service-token verification uses a constant-time comparison.
Changes:
- Compose workspace-store
initialize/closehooks with existinginternal.initialize/internal.closeinattachWorkspaceStoreLifecycle. - Replace direct string comparison of service tokens with
timingSafeEqualon SHA-256 digests. - Add minimal
node:cryptodeclarations to the repo’s hand-rolled Node typings.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/index.ts | Composes lifecycle hooks and switches auth token comparison to constant-time digest compare. |
| src/@types/node/index.d.ts | Adds node:crypto type declarations needed for the new constant-time comparison. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…n digest Agent-Logs-Url: https://github.com/ryanjosebrosas/secondbrain-engine/sessions/10ff1fa9-d87d-403b-818a-4cd2fa51362f Co-authored-by: ryanjosebrosas <178813774+ryanjosebrosas@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
Both items in that review are already addressed in commit 33dd9bb: |
|
@copilot apply changes based on the comments in this thread |
All three items in that review are already addressed in commit 33dd9bb:
|
|
@copilot apply changes based on the comments in this thread |
All three items are already implemented in commit 33dd9bb:
|
|
@copilot review |
Agent-Logs-Url: https://github.com/ryanjosebrosas/secondbrain-engine/sessions/dfd8415d-21ed-4b5a-bbc3-9c237e61574a Co-authored-by: ryanjosebrosas <178813774+ryanjosebrosas@users.noreply.github.com>
Review complete. The three items from the original review thread are correctly implemented in commit 33dd9bb. One regression was found and fixed in bc95481: Regression fixed: The All other changes are sound:
|
…gregation Co-authored-by: ryanjosebrosas <178813774+ryanjosebrosas@users.noreply.github.com>
Resolves merge conflict between this branch and
a7u-pr-final, and fixes a regression where theclosehook would short-circuit on the first failure, leaving remaining stores unclosed.Changes
Merge conflict resolution —
src/index.tsconflicted on theattachWorkspaceStoreLifecycleimplementation; resolved in favor of this branch's improved logic (storesForInit/storesForClosededuplication, correct hook ordering).Error aggregation restored in
close— Previous refactor dropped the try/catch collection pattern.internal.close()and each store'sclose()are now all attempted regardless of individual failures; errors surface asAggregateError.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.