This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs in event validation and make criteria stronger
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
- Loading branch information
Showing
10 changed files
with
199 additions
and
85 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"events": [ | ||
{ | ||
"retrievalId": "d05a522e-9608-401a-a33f-1eb4ac4111a0", | ||
"instanceId": "test-instance-id", | ||
"cid": "bafybeic4jpi2detp5n3q6rjo7ckulebtr7dsvt2tbrtcqlnnzqmi3bzz2y", | ||
"storageProviderId": "12D3KooWHwRmkj4Jxfo2YnKJC4YBzTNEGDW6Et4E68r7RYVXk46h", | ||
"phase": "query", | ||
"phaseStartTime": "2023-03-02T00:15:50.479910907Z", | ||
"eventName": "started", | ||
"eventTime": "2223-03-02T00:15:52.361371026Z" | ||
} | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"events": [ | ||
{ | ||
"retrievalId": "d05a522e-9608-401a-a33f-1eb4ac4111a0", | ||
"instanceId": "test-instance-id", | ||
"cid": "bafybeic4jpi2detp5n3q6rjo7ckulebtr7dsvt2tbrtcqlnnzqmi3bzz2y", | ||
"storageProviderId": "12D3KooWHwRmkj4Jxfo2YnKJC4YBzTNEGDW6Et4E68r7RYVXk46h", | ||
"phase": "query", | ||
"phaseStartTime": "2223-03-02T00:15:50.479910907Z", | ||
"eventName": "started", | ||
"eventTime": "2023-03-02T00:15:52.361371026Z" | ||
} | ||
] | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"events": [ | ||
{ | ||
"retrievalId": "d05a522e-9608-401a-a33f-1eb4ac4111a0", | ||
"instanceId": "test-instance-id", | ||
"cid": "fish", | ||
"storageProviderId": "12D3KooWHwRmkj4Jxfo2YnKJC4YBzTNEGDW6Et4E68r7RYVXk46h", | ||
"phase": "query", | ||
"phaseStartTime": "2023-03-02T00:15:50.479910907Z", | ||
"eventName": "started", | ||
"eventTime": "2023-03-02T00:15:52.361371026Z" | ||
} | ||
] | ||
} |
Oops, something went wrong.