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

Added Support colons in legacy GIDs #7304

Merged
merged 3 commits into from
Jul 25, 2024
Merged

Conversation

tobias-tengler
Copy link
Collaborator

@tobias-tengler tobias-tengler commented Jul 24, 2024

While preparing our Framework code for Hot Chocolate v14, I noticed that we have some (strongly typed) Ids that contain colons (:). This is problematic with the current implementation of the new Node Id Serializer, as it looks for : as the separator between Type name and Id value and doesn't consider that it might be dealing with a legacy Id that contains a colon.

This PR adds support for colons in Id values by looking for both the new : and old \n delimiter.

This of course impacts the hot path, but I think it's warranted. If someone were to implement a custom Id format (doesn't even have to be strongly typed, it could just be a string with another dalimiter) I would assume that the delimiter being chosen would be : 95% of the time. I'd therefore assume that there is probably at least one such Id in each larger code base. I think it would be really nice, if the new solution would be a drop-in replacement and wouldn't require any migration effort.

@tobias-tengler tobias-tengler force-pushed the tte/handle-colons-in-legacy-ids branch from eaaa5c5 to 110bc81 Compare July 24, 2024 20:17
@tobias-tengler tobias-tengler changed the title Handle colons in legacy GIDs Support colons in legacy GIDs Jul 24, 2024
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.73%. Comparing base (df52cdf) to head (110bc81).

Files Patch % Lines
...pes/Relay/Serialization/DefaultNodeIdSerializer.cs 82.60% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7304      +/-   ##
==========================================
+ Coverage   75.83%   76.73%   +0.89%     
==========================================
  Files        2473     2771     +298     
  Lines      122307   137889   +15582     
==========================================
+ Hits        92755   105811   +13056     
- Misses      29552    32078    +2526     
Flag Coverage Δ
unittests 76.73% <91.30%> (+0.89%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaelstaib michaelstaib merged commit 6033f2e into main Jul 25, 2024
14 checks passed
@michaelstaib michaelstaib deleted the tte/handle-colons-in-legacy-ids branch July 25, 2024 04:40
@michaelstaib michaelstaib changed the title Support colons in legacy GIDs Added Support colons in legacy GIDs Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants