Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose the peerId that created the operations #551

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

trungnotchung
Copy link
Member

@trungnotchung trungnotchung commented Mar 10, 2025

What type of PR is this?

  • Feature

Description

  • Created new interface DRPRuntimeContext and added to the IDRP.
  • Updated the DRPObject to update drp.context before applying an opeartion to the drp.
  • Updated all examples and blueprints.
  • Updated relevant tests and added new tests for that.

Related Issues and PRs

Added/updated tests?

  • Yes

Additional Info

add instructions or screenshots on what you might think is relevant or instructions on how to manually test it

[optional] Do we need to perform any post-deployment tasks?

Copy link

github-actions bot commented Mar 10, 2025

Flamegraph.com report

flamegraph.pprof
See in flamegraph.com

Created by Flamegraph.com Github Action

Copy link

github-actions bot commented Mar 10, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 86.03% 3154 / 3666
🔵 Statements 86.03% 3154 / 3666
🔵 Functions 84.16% 271 / 322
🔵 Branches 84.94% 824 / 970
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/object/src/index.ts 90% 80.95% 100% 90% 171-172, 176, 208-209, 224-225, 232-234, 255-256, 269-272, 301-302, 313-314, 354-355, 436-440, 448-449, 454-455, 466-467, 475-476, 491-492, 510-511, 519-520, 537-538, 551-552, 609-614, 629, 647-648, 658-659
packages/object/src/acl/index.ts 91.47% 82.75% 100% 91.47% 58-59, 80, 86-87, 95, 103, 159-162
packages/types/src/drp.ts 0% 100% 100% 0% 7-15
Generated in workflow #2412 for commit 077b7eb by the Vitest Coverage Report Action

@trungnotchung trungnotchung marked this pull request as ready for review March 13, 2025 14:36
Comment on lines 359 to 367
if (!caller) {
throw new Error("Caller is undefined");
}
if (target.context) {
target.context.caller = caller;
} else {
throw new Error("Target does not have a context to update.");
}

Copy link
Contributor

Choose a reason for hiding this comment

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

why you mark the caller as optional then enforce checks like this? I think it's better to force on the function params

Copy link
Member Author

Choose a reason for hiding this comment

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

i did it because peerId can be undefined in _computeDRP. Agree it's better to check it there before calling _applyOperation.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

sfroment and others added 6 commits March 13, 2025 17:36
* origin:
  feat!: handle async DRP function  (#555)
  feat: interval-drp-discovery (#528)
* origin:
  fix: tsconfig for interval discovery (#564)
Signed-off-by: Sacha Froment <[email protected]>
Copy link
Member

@JanLewDev JanLewDev left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

Comment on lines 29 to 32
/**
* The context metadata for a request.
*/
context?: DrpRuntimeContext;
Copy link
Member

Choose a reason for hiding this comment

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

I would put it below semantics type

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

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.

[FEATURE] - Expose the peerId that created the operations
4 participants