-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
DataType.prototype.getByVersionId
could return wrong type
We have many `DataType`s backed by the same `DataStore`. For example, observations and tracks are both in the "data" store. `DataType.prototype.getByVersionId` would pull documents from the store without checking the type, which could cause issues. Simple code example: const track = await trackDataType.create({ /* ... */ }) await observationDataType.getByVersionId(track.versionId) // => the track, unexpectedly! Now, it throws a `NotFoundError`.
- Loading branch information
Showing
2 changed files
with
45 additions
and
4 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