You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...
const wrappedCallback = function (err, ret) {
if (err || (ret && ret.insertedId)) {
// Send any errors to afterInsert
afterInsert(ret.insertedId, err)
} else {
...
In the function, if err is truthy, ret may still be undefined. Control will flow into the afterInsert, but ret.insertedId will fail to dereference ret and throw it's own error.
At this point, we are blocked as we can't apply the error to the upsert that caused it. So just record it to the server console, I suppose...
...
const wrappedCallback = function (err, ret) {
if (err) {
if (ret && ret.insertedId) {
// Send any errors to afterInsert
afterInsert(ret.insertedId, err)
} else {
// unable to recover the id, we need to punt.
console.error(err);
}
} else {
...
This error seems to be in all releases of the package. I can only suppose that the problem went unnoticed based on the relative rarity of upserts and the added rarity of problems when upserting.
The text was updated successfully, but these errors were encountered:
We, the Members of Meteor Community Packages take every issue seriously.
Our goal is to provide long-term lifecycles for packages and keep up
with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.
However, we contribute to these packages mostly in our free time.
Therefore, we can't guarantee you issues to be solved within certain time.
If you think this issue is trivial to solve, don't hesitate to submit
a pull request, too! We will accompany you in the process with reviews and hints
on how to get development set up.
Please also consider sponsoring the maintainers of the package.
If you don't know who is currently maintaining this package, just leave a comment
and we'll let you know.
eymiha
changed the title
logic error in error reporting on upsert failue
logic error in error reporting on upsert failure
Oct 11, 2024
in 1.3.2, in os/upsert.js, at line 82,
In the function, if err is truthy, ret may still be undefined. Control will flow into the afterInsert, but ret.insertedId will fail to dereference ret and throw it's own error.
At this point, we are blocked as we can't apply the error to the upsert that caused it. So just record it to the server console, I suppose...
This error seems to be in all releases of the package. I can only suppose that the problem went unnoticed based on the relative rarity of upserts and the added rarity of problems when upserting.
The text was updated successfully, but these errors were encountered: