Open EvanHahn opened 1 week ago
We have many DataTypes backed by the same DataStore. For example, observations and tracks are both in the "data" store.
DataType
DataStore
DataType.prototype.getByVersionId would pull documents from the store without checking the type, which could cause issues. Simple code example:
DataType.prototype.getByVersionId
const track = await trackDataType.create({ /* ... */ }) await observationDataType.getByVersionId(track.versionId) // => the track, unexpectedly!
Now, it throws a NotFoundError.
NotFoundError
We have many
DataType
s backed by the sameDataStore
. 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:Now, it throws a
NotFoundError
.