Preserve and sanitise imported heartbeat strings - #1689
Open
skyfallwastaken wants to merge 2 commits into
Open
Conversation
Base automatically changed from
fix-orb-compose-install
to
add-heartbeat-remapper
September 6, 2026 13:16
Co-authored-by: Amp <amp@ampcode.com>
skyfallwastaken
force-pushed
the
fix-import-null-bytes
branch
from
September 6, 2026 13:16
e698ae8 to
1e83627
Compare
Contributor
Greptile SummaryThis PR replaces the deprecated SAJ parser with Oj's streaming ScHandler and sanitises imported heartbeat strings before normalisation and identity hashing.
Confidence Score: 5/5The PR appears safe to merge, with the previous metadata-lookup issue addressed and regression tests covering the corrected behaviour. The current implementation sanitises both imported user-agent identifiers and metadata-map keys before lookup, fully addressing the previous finding. No new actionable correctness, security or repository-rule violations remain. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Imported JSON] --> B[Oj ScHandler]
B --> C[Stream heartbeat objects]
C --> D[Strip embedded NUL bytes]
E[User-agent metadata map] --> F[Sanitise identifier keys]
F --> G[Resolve metadata]
D --> G
G --> H[Normalise heartbeat]
H --> I[Compute canonical identity]
I --> J[Persist or classify as duplicate]
Reviews (2): Last reviewed commit: "Sanitise imported user agent lookup iden..." | Re-trigger Greptile |
Co-authored-by: Amp <amp@ampcode.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of the problem
The deprecated Oj SAJ parser silently truncated imported strings at embedded NUL characters. Import normalisation also lacked the sanitation used by direct ingestion.
Describe your changes
Use the streaming ScHandler parser and strip NUL characters before normalisation and identity hashing, preserving the remaining string content and replay deduplication.
Screenshots / Media
Not applicable: backend-only changes.