fix: address testing and documentation issues#1284
Merged
ogazboiz merged 1 commit intoJun 28, 2026
Conversation
- Fix IndexedEventsService.create return type to Promise<IndexedEvent | null> * Returns null on duplicate event_id instead of undefined cast as IndexedEvent * Add test for duplicate event_id path (closes LabsCrypt#1166) - Add unit tests for authService security helpers * verifySignature: valid sig, wrong signer, non-64-byte, non-base64, invalid key * verifyChallengeTimestamp: at/under/over window, future timestamp * extractBearerToken: null, wrong scheme, malformed headers (closes LabsCrypt#1168) - Add comprehensive tests for scoresService * Un-skip param-assertion tests for updateUserScoresBulk * Add clamping tests for 300/850 boundaries (insert and update) * Add full test coverage for setAbsoluteUserScoresBulk * Cover empty-map and empty-user-id no-op paths (closes LabsCrypt#1170) - Expand services README with layer overview * Add services index table with responsibilities and entry points * Document background schedulers and their wiring in index.ts * Note key env vars read by each service (closes LabsCrypt#1172)
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
This PR addresses four testing and documentation issues found in the backend codebase.
Changes
Issue: IndexedEventsService.create return type
Promise<IndexedEvent>toPromise<IndexedEvent | null>nullon duplicateevent_idinstead ofundefinedcast as non-nullableIssue: authService helper unit tests
verifySignature()covering valid sig, wrong signer, non-64-byte sig, non-base64 input, and invalid public keyverifyChallengeTimestamp()at/under/over expiry window and future timestampsextractBearerToken()covering null, wrong scheme, malformed headers, and happy pathIssue: scoresService test coverage
updateUserScoresBulksetAbsoluteUserScoresBulkcovering value placeholders, cache invalidation, error propagation, and empty-map/empty-user-id no-opsIssue: services layer documentation
index.tsTesting
All new tests pass locally. The fixes strengthen type safety and test coverage for security-critical paths.
Closes #1166
Closes #1168
Closes #1170
Closes #1172