Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Fix bugs in event validation and make criteria stronger #9

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

masih
Copy link
Member

@masih masih commented Mar 2, 2023

Fix bugs where:

  • empty events in batch were considered valid
  • cid was not checked for validity
  • peer ID was not checked for validity
  • time span of start and event time was unchecked.

Refactor codes to instead check the zero valued struct for validity, as we need to do that anyway. Using pointers doesn't make sense here because all the pointer fields are required to have valid content and we do not need to infer whether they were actually present in JSON or not.

Add extra tests to cover more edge cases

@masih masih requested review from kylehuntsman and willscott March 2, 2023 13:29
Fix a bugs where:
 * empty events in batch were considered valid
 * cid was not checked for validity
 * peer ID was not checked for validity
 * time span of start and event time was unchecked.

Refactor codes to instead check the zero valued struct for validity, as
we need to do that anyway. Using pointers doesn't make sense here
because all the pointer fields are required to have valid content and we
do not need to infer whether they were actually present in JSON or not.

Add extra tests to cover more edge cases
@masih masih force-pushed the masih/event_validation_fix_bugs branch from 8dbacf2 to ea9409f Compare March 2, 2023 13:30
@masih masih merged commit a052eb5 into main Mar 2, 2023
@masih masih deleted the masih/event_validation_fix_bugs branch March 2, 2023 13:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants