-
Notifications
You must be signed in to change notification settings - Fork 7
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
Make endCursor non-nullable #139
Conversation
Warning Rate limit exceeded@fracek has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 50 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis pull request introduces changes to the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/protocol/src/stream.ts (1)
Line range hint
129-142
: Consider version bump and migration guide.Both changes (making
output
andendCursor
non-optional) are breaking changes that affect the public API. This warrants:
- A major version bump following semver
- A migration guide for consumers
- Clear documentation of the breaking changes in the changelog
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
change/@apibara-protocol-214b6685-d554-4d94-9256-a80ee0fd751b.json
(1 hunks)packages/protocol/src/stream.ts
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- change/@apibara-protocol-214b6685-d554-4d94-9256-a80ee0fd751b.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: test
🔇 Additional comments (1)
packages/protocol/src/stream.ts (1)
129-129
: Approve makingoutput
non-optional, but flag as breaking change.Making
output
non-optional inSystemMessage
is a good change as system messages should always have output. However, this is a breaking change that might affect existing consumers.Let's verify the type consistency:
✅ Verification successful
Verified: Type system is consistent with non-optional
output
changeThe change to make
output
non-optional inSystemMessage
is correctly reflected throughout the type system. While this is a breaking change, it's well-contained and properly typed.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check if the type definition matches the schema rg -A 10 "StreamDataResponse<TA>" packages/protocol/src/stream.tsLength of output: 360
Script:
#!/bin/bash # Find SystemMessage definition and usages ast-grep --pattern 'type SystemMessage = $_' rg "SystemMessage" packages/protocol/src/stream.tsLength of output: 384
@@ -139,7 +139,7 @@ export const Data = <TA, TR>( | |||
_tag: tag("data"), | |||
data: Schema.Struct({ | |||
cursor: Schema.optional(Cursor), | |||
endCursor: Schema.optional(Cursor), | |||
endCursor: Cursor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix inconsistency in type definition for endCursor
.
While making endCursor
non-optional in the schema is correct, there's an inconsistency in the exported type definition that still shows it as optional:
export type StreamDataResponse<TA> = ... {
data: {
endCursor?: Cursor | undefined; // Still optional
}
}
Please update the type definition to match the schema:
export type StreamDataResponse<TA> =
| ResponseWithoutData
| {
_tag: "data";
data: {
cursor?: Cursor | undefined;
- endCursor?: Cursor | undefined;
+ endCursor: Cursor;
finality: DataFinality;
production: DataProduction;
data: readonly (TA | null)[];
};
};
7a2608e
to
4e7614a
Compare
4e7614a
to
3300063
Compare
No description provided.