Publish protocol 0.1.1 deletion routing - #1
Conversation
📝 WalkthroughWalkthroughThe change releases ChangesProtocol and runtime behavior
Release and delivery baseline
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant BlockService
participant Database
participant Response
Client->>BlockService: block.remove
BlockService->>Database: delete block relation
Database-->>BlockService: deletion result
BlockService->>Response: create block.remove.result
Response-->>Client: timestamped result
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
|
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
worker.js (1)
5936-5983: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftConsume the candidate grant before side effects.
Two concurrent likes can both pass the
SELECTat Line 5943 before either request reaches Line 5981. Each request then incrementsdaily_likes_sent, althoughINSERT OR IGNOREcreates only one intent. Delete the exact validated token with a conditionalDELETEfirst, checkmeta.changes, and only then create the intent and increment the quota. Update the source matcher service and regenerate this bundle.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@worker.js` around lines 5936 - 5983, The validated candidate grant must be consumed before any like side effects to prevent concurrent reuse. In the candidate-grant flow, replace the later broad delete with a conditional DELETE matching viewer_id, candidate_id, and the validated candidateGrant, check its meta.changes, and return the existing invalid_candidate_grant error when no row was deleted; only then execute intent creation and quota updates. Apply the change in the source matcher service and regenerate the worker bundle.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Line 82: Update both checkout steps in the dependency-review and main jobs to
set persist-credentials to false; additionally, gate the dependency-review
checkout with github.event_name == 'pull_request' if the review action does not
require local files for push events. Keep the existing checkout and npm ci flow
unchanged otherwise.
In `@README.md`:
- Around line 129-131: Update the README installation example to reference a
version of opendating-protocol that is available on npm, or publish version
0.1.1 before retaining the command. Ensure the documented npm install command
resolves successfully for users.
In `@src/protocols/opendating/protocol/routing.ts`:
- Line 23: Update the profile supported-type list in the identities loader so it
includes the visibility.update protocol type declared in routing.ts. Use the
existing protocol identifier and preserve ProfileService’s accepted request
behavior, ensuring capability-aware clients advertise and allow this profile
request.
In `@src/protocols/opendating/services/block/service.ts`:
- Around line 40-51: The removeBlock method currently accepts any nonempty
target_pubkey; validate that it is exactly 64 hexadecimal characters before
calling getMemberId. Return the existing invalid_envelope response for malformed
values, while preserving valid-key handling.
---
Outside diff comments:
In `@worker.js`:
- Around line 5936-5983: The validated candidate grant must be consumed before
any like side effects to prevent concurrent reuse. In the candidate-grant flow,
replace the later broad delete with a conditional DELETE matching viewer_id,
candidate_id, and the validated candidateGrant, check its meta.changes, and
return the existing invalid_candidate_grant error when no row was deleted; only
then execute intent creation and quota updates. Apply the change in the source
matcher service and regenerate the worker bundle.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3e50f617-8502-422b-97f6-2d12c1602033
⛔ Files ignored due to path filters (14)
package-lock.jsonis excluded by!**/package-lock.jsonpackages/protocol/dist/index.d.tsis excluded by!**/dist/**packages/protocol/dist/index.d.ts.mapis excluded by!**/dist/**,!**/*.mappackages/protocol/dist/index.jsis excluded by!**/dist/**packages/protocol/dist/index.js.mapis excluded by!**/dist/**,!**/*.mappackages/protocol/dist/protocol/constants.d.tsis excluded by!**/dist/**packages/protocol/dist/protocol/constants.d.ts.mapis excluded by!**/dist/**,!**/*.mappackages/protocol/dist/protocol/constants.jsis excluded by!**/dist/**packages/protocol/dist/protocol/constants.js.mapis excluded by!**/dist/**,!**/*.mappackages/protocol/dist/protocol/routing.d.tsis excluded by!**/dist/**packages/protocol/dist/protocol/routing.d.ts.mapis excluded by!**/dist/**,!**/*.mappackages/protocol/dist/protocol/routing.jsis excluded by!**/dist/**packages/protocol/dist/protocol/routing.js.mapis excluded by!**/dist/**,!**/*.mappackages/protocol/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (19)
.github/workflows/ci.ymlREADME.mddocs/opendating/PROTOCOL-0.1.1-RELEASE.mddocs/opendating/PROTOCOL.mddocs/opendating/ROADMAP.mdpackage.jsonpackages/protocol/README.mdpackages/protocol/package.jsonpackages/protocol/src/index.tspackages/protocol/src/protocol/constants.tspackages/protocol/src/protocol/routing.tssrc/protocols/opendating/identities/loader.tssrc/protocols/opendating/protocol/constants.tssrc/protocols/opendating/protocol/routing.tssrc/protocols/opendating/services/block/service.tstests/opendating/conformance/protocol.test.tstests/opendating/integration/services.test.tstests/opendating/unit/service-identities.test.tsworker.js
Outcome
Repairs the v0.1 service contract without changing the wire version and prepares opendating-protocol 0.1.1 for publication.
Changes
Verification
Publication blocker
The package is buildable and packable, but npm publication is not attempted because the local npm session is not authenticated. After review and merge, authenticate npm, publish [email protected], and pin the mobile repository to that artifact.