-
Notifications
You must be signed in to change notification settings - Fork 2
fix: code review findings — QR size, URL normalization, enableLink, VALID_RANGES, SDK type/sentinel bugs #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
91a5ff4
fix(api): wire QR size param, normalize URLs in updateLink, use enabl…
claude d19edf2
fix(sdk/typescript): qr() size param type string -> number
claude 7932123
fix(sdk/python): sentinel pattern for nullable fields in update()
claude 63d2d6e
fix(sdk/dart): sentinel pattern for nullable fields in update()
claude 711a998
constants: harmonize slug-length cap at 128 via MAX_SLUG_LENGTH
DennisAlund 8d6f3e4
api/qr: reject non-positive and out-of-range size
DennisAlund 1cf7013
sdk: bump x-spec-hash for slug-length and QR size schema changes
DennisAlund f4145bd
sdk/dart: switch update() to take a model and add copyWith
DennisAlund 1c9dc03
test/api-schemas: track new MAX_SLUG_LENGTH boundary
DennisAlund 7423f55
test(handler/redirect-kv): label POST to suppress autoLabelLink fetch
DennisAlund fbac310
api/qr: hoist size bounds to constants, enforce max on both routes
DennisAlund b596f84
api/qr,mcp: default to primary slug, not first custom
DennisAlund c51d7fc
sdk/dart: bump 1.1.0 -> 2.0.0 for breaking update() signature
DennisAlund 0f02798
qr: enforce MAX_QR_SIZE at the renderer too
DennisAlund 73ef262
api/qr: reject empty ?slug= with 400 on the admin route
DennisAlund df19b9a
services/links: map enable() race-condition null to 404
DennisAlund 888d18e
sdk/dart: docs polish for 2.0.0
DennisAlund File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| name: shrtnr | ||
| description: Dart client for the shrtnr URL shortener API. Create short links, manage custom slugs, and read click analytics. | ||
| version: 1.0.1 | ||
| version: 2.0.0 | ||
| homepage: https://oddb.it/shrtnr-website-pub | ||
| repository: https://github.com/oddbit/shrtnr | ||
| issue_tracker: https://github.com/oddbit/shrtnr/issues | ||
| # x-spec-hash: sha256:3b6e9163bac619b9bbef7ba774b2cd06a9a968f1223b85ba302a018c4bee3b57 | ||
| # x-spec-hash: sha256:0d54031654375b3a269cd23d05d66ff44a4b10a894d09b55ed2c1c66405c25b8 | ||
|
Comment on lines
1
to
+7
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, breaking signature change on 1.x should bump to 2.x under SemVer. Bumped to 2.0.0 in |
||
| # Stored as a comment rather than a top-level key to avoid a pana score deduction for unknown manifest fields. | ||
|
|
||
| topics: | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Leaving this. The
Object? = _unsetshape is the standard Dart idiom for omit-vs-explicit-null incopyWith: it's exactly whatfreezedgenerates, and the equivalents (Optional<T>, record-based(T,)wrappers) make every call site noisier even for the common non-null set case (copyWith(label: const Maybe('x'))vscopyWith(label: 'x')).The model fields themselves stay typed (
Link.labelisString?). TheObject?only leaks at thecopyWithparameter, the runtime castas String?throws on a wrong-type pass, and IDE auto-complete picks the field's declared type. That seems like a fair trade for the call-site ergonomics, and the test suite covers omit/clear/set across both classes.