Skip to content

fix(test): register action-retrier at the nested component path - #85

Open
mayuriphad wants to merge 3 commits into
convex:mainfrom
mayuriphad:fix/test-register-action-retrier-path
Open

mayuriphad wants to merge 3 commits into
convex:mainfrom
mayuriphad:fix/test-register-action-retrier-path

Conversation

@mayuriphad

@mayuriphad mayuriphad commented Oct 5, 2026 •

Copy link
Copy Markdown

Fixes #72

Problem

@convex-dev/r2/test's register(t) registers action-retrier with actionRetrier.register(t), which uses the default top-level name "actionRetrier". The component installs action-retrier as a child (component.use(actionRetrier) in convex.config.ts), so at runtime deleteObject/store look it up at "r2/actionRetrier". In a consumer test that follows the documented r2Test.register(t) pattern this throws:

Error: Component "r2/actionRetrier" is not registered. Call "t.registerComponent".

Change

  • src/test.ts: register action-retrier at `${name}/actionRetrier`, so it follows a custom component name too.
  • src/test.test.ts: checks that register registers r2 and r2/actionRetrier (and <name>/actionRetrier for a custom name), and never the top-level actionRetrier.

Testing

npx vitest run src/test.test.ts passes with the change and fails on both cases without it. tsc --noEmit, eslint and prettier --check are clean on the changed files.

The component installs action-retrier as a child, so an app that uses r2
resolves it at "<name>/actionRetrier". register() in the test helper
registered it at the top-level "actionRetrier", so deleteObject and store
threw `Component "r2/actionRetrier" is not registered` in tests that follow
the documented r2Test.register(t) pattern.

Register it under `${name}/actionRetrier` and add a test for the default and
a custom component name.

Fixes convex#72
Copilot AI balanced review requested due to automatic review settings October 5, 2026 09:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: convex/coderabbit/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8faf6a65-8bbe-48c6-a774-0f6ca84b3b10
📥 Commits

Reviewing files that changed from the base of the PR and between 5ce22f3 and 77082dc.

📒 Files selected for processing: 1
  • src/test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

register now registers the component first, then registers actionRetrier as ${name}/actionRetrier. Tests check the default r2 name and the custom storage name. They also verify that registration does not use the top-level actionRetrier name.

Suggested reviewers: ianmacartney

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 77082

The retrier is registered where the component looks it up, with no identified merge-blocking risk from this change.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to c3b2b

The change corrects test registration to match the existing nested component structure. It does not introduce a new production entrypoint, privilege, or deployment behavior.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed registration behavior is scoped to the caller-supplied test instance. The inspected change does not add production authority or alter production component ownership.

Trust Boundaries and Controls

  • observed — The helper uses the same supplied name for the parent registration and the child-name prefix. This aligns test identity with the existing parent-owned retrier reference; it is not a newly introduced authorization control.

Resilience and Maintainability Implications

  • inferred — A failed child registration could leave partial test-instance state because both versions register the parent first without local cleanup. The PR preserves this structure; external failure and repetition semantics remain unverified, with no identified security-relevant production recovery change.
Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the fix: registering action-retrier at the nested component path.
Description check Passed The description explains the registration problem, the path change, the tests, and the reported validation results.
Linked Issues check Passed Issue #72 requires register to register action-retrier at the nested component path. src/test.ts registers it at ${name}/actionRetrier after registering the component. src/test.test.ts verifie…
Out of Scope Changes check Passed The source change and tests directly address issue #72. The reviewed changes contain no demonstrated unrelated work.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mayuriphad
mayuriphad force-pushed the fix/test-register-action-retrier-path branch from c3b2b49 to 1361dba Compare October 6, 2026 05:43
…ion-retrier-path

Signed-off-by: mayuriphad <mayuriphad656@gmail.com>

# Conflicts:
#	src/test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test.ts's register() registers actionRetrier at the wrong (top-level) name — deleteObject/store unusable in consumer tests

3 participants