Meteor-Community-Packages / Meteor-Community-Packages/meteor-collection2

Meteor 3.0 potential bug

Open
#445 7 comments 1 reaction 0 assignees View on GitHub
potential bug will accept pull request
Dominant language
JavaScript
Stars
1k
Forks
112
PR merge metrics
No merged PRs in 30d

Description

As reported in Slack by @StorytellerCZ :

```bash

W20240122-18:59:31.199(1)? (STDERR) meteor://💻app/packages/mongo.js:3584
W20240122-18:59:31.200(1)? (STDERR) throw new Error("".concat(m, " + is not available on the server. Please use ").concat(getAsyncMethodName(m), "() instead."));
W20240122-18:59:31.200(1)? (STDERR) ^
W20240122-18:59:31.200(1)? (STDERR)
W20240122-18:59:31.200(1)? (STDERR) Error: update + is not available on the server. Please use updateAsync() instead.
W20240122-18:59:31.200(1)? (STDERR) at Object.ret. [as update] (packages/mongo/remote_collection_driver.js:52:15)
W20240122-18:59:31.200(1)? (STDERR) at Collection.update (packages/mongo/collection.js:959:31)
W20240122-18:59:31.200(1)? (STDERR) at Collection.Mongo.Collection. [as update] (packages/aldeed:collection2/main.js:236:23)
W20240122-18:59:31.200(1)? (STDERR) at packages/accounts-oauth/oauth_server.js:94:41
W20240122-18:59:31.200(1)? (STDERR) at AsynchronousCursor.forEach (packages/mongo/mongo_driver.js:1115:22)
W20240122-18:59:31.200(1)? (STDERR) at processTicksAndRejections (node:internal/process/task_queues:95:5)
W20240122-18:59:31.200(1)? (STDERR)
W20240122-18:59:31.200(1)? (STDERR) Node.js v20.9.0

```

If I add

```js
if (Meteor.isServer && Meteor.isFibersDisabled) {
return null
}
```
to line 236 in `main.js` it goes away. Probably not the best approach though.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Meteor 3.0 server failure using the stack trace, then inspect main.js around line 236 and the related collection update path. Compare the reported behavior with the Mongo and accounts-oauth call sites shown in the trace. Done means confirming the cause and defining a supported fix or documenting why the current update call must change.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, node.js
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.