-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1679375 - Implement the base of the metrics database module #9
Conversation
FYI: CI didn't run for this PR, because it was not set up to run for PRs from forks. I changed that and it should run for next commits. |
Co-authored-by: Alessio Placitelli <alessio.placitelli@gmail.com>
76213b1
to
dc85e0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+wc
if (isObject(value)) { | ||
console.error(`Unexpected value found for metric ${metric}: ${JSON.stringify(value)}. Clearing.`); | ||
await store.delete([ping, metric.type, storageKey]); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still a bit puzzled by this, but we can revisit later: promises can be resolved or rejected, so maybe we can just assume that if it is resolved it has a value, otherwise rejected? Nothing to do now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I considered just leaving the data there. But that would just mean this would fail until we record/transform again, because we leave the corrupted data there...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep up this discussion on the bug I opened to investigate the best behaviour for this :)
As was described in the proposal, the database module will differ from the glean-core database module.
While it will serve as an abstraction layer over the underlying storage, it will also be the interface to retrive the ping / metric payload data from the storage. This is a bit easier for Glean.js, because the data is saved already in the format that is expected by the ping schema.
I will leave comments on the code about some doubts that lingered after I was finished with this implementation.