Meteor-Community-Packages / Meteor-Community-Packages/meteor-timesync

Timesync.serverTime running each sec in nonReactive mode

Open
#20 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
119
Forks
37
PR merge metrics
No merged PRs in 30d

Description

I want to access server time on client side though only when queried for. So I have a function to get the current server time non-reactively:

```
getServerTime = function() {
var serverTime;
if (!TimeSync.isSynced()) {
TimeSync.resync();
} else {
serverTime = Deps.nonreactive(function() {
return TimeSync.serverTime();
})
}
return serverTime;
}
```

It used to work fine in meteor 0.8.3 but now I have upgraded to meteor 1.0 and TimeSync.serverTime runs continuously causing my subscribes to run infinitely.

Does it need some change for meteor 1.0?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the shown getServerTime function with Meteor 1.0, focusing on TimeSync.serverTime(), TimeSync.resync(), and Deps.nonreactive(). Compare whether serverTime remains reactive and identify why subscriptions rerun continuously; done means a non-reactive query returns server time without repeated subscription execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
full-stack
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.