Skip to content

chore: reject circular references in tags - #280

Merged
TheUnderScorer merged 1 commit into
mainfrom
chore/reject-cycle-tags
Sep 30, 2026
Merged

TheUnderScorer merged 1 commit into
mainfrom
chore/reject-cycle-tags

Conversation

@kevinmia

Copy link
Copy Markdown
Contributor

Caught this thread while doing testing around the v4 SDK pre-release: https://fingerprintjs.slack.com/archives/C050TKU9X5L/p1789981894548149.

Noticed that the Flutter SDK validates tags and rejects cycles, which isn't handled in this SDK. This PR updates things so that a circular tags object throws a clear TypeError naming the exact path where the cycle closes, instead of an unhandled RangeError: Maximum call stack size exceeded.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Following releases will be created using changesets from this PR:

@fingerprint/react-native@4.0.0-rc.2

Patch Changes

  • Fixed tags validation to reject circular references with a clear TypeError instead of throwing an unhandled RangeError: Maximum call stack size exceeded. (f102cf0)

@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements
92.05% (+0.09% 🔼)
243/264
🟢 Branches
89.79% (+0.09% 🔼)
211/235
🟢 Functions 85.71% 48/56
🟢 Lines
91.7% (+0.1% 🔼)
232/253

Test suite run success

95 tests passing in 6 suites.

Report generated by 🧪jest coverage report action from f102cf0

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 92.04 89.78 85.71 91.69
🟢  src 92.04 89.78 85.71 91.69
🟢   FingerprintClient.ts 100 90 100 100 22,41,54
🔴   FingerprintClient.web.ts 0 0 0 0 5-58
🟡   FingerprintContext.ts 66.66 100 0 66.66 6
🟢   FingerprintProvider.tsx 100 100 100 100
🟡   errors.ts 75 50 50 75 3,121
🟢   getOptionsCacheKey.ts 84 83.33 100 83.33 10,33,43,52
🔴   index.ts 0 0 0 0
🟢   tags.ts 95 94.44 100 95 31
🔴   types.ts 0 0 0 0
🟢   unwrapError.ts 100 88.46 100 100 18-19,40
🟢   unwrapError.web.ts 100 100 100 100
🔴   useFingerprint.ts 0 0 0 0 24-28
🟢   usePromiseStore.ts 100 100 100 100
🟢   useVisitorData.ts 95.91 85.71 90 95.74 166-167
🟢   utils.ts 100 100 100 100
🔴  src/specs 0 0 0 0
🔴   NativeRNFingerprint.ts 0 0 0 0

@TheUnderScorer
TheUnderScorer merged commit d930d5e into main Sep 30, 2026
29 checks passed
@TheUnderScorer
TheUnderScorer deleted the chore/reject-cycle-tags branch September 30, 2026 10:01
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.

2 participants