Trying to render an application with some initialData, which triggers some async calls.
if (query.state.data) {
query.scheduleStaleTimeout(); // Simulate a query healing process
query.heal(); // Schedule for garbage collection in case
// nothing subscribes to this query
query.scheduleGarbageCollection();
}
The scheduleStaleTimeout() and scheduleGarbageCollection() can be prevented from running by setting stale and cache to Infinity, but heal() will always call a clearTimeout function.
In our server environment calling setTimeout or clearTimeout throws an error.
The fix is to add the isServer check to the if statement - I'm just not sure if there's any consequences to doing this? Does the server actually need to call any of these methods?
Trying to render an application with some
initialData, which triggers some async calls.The
scheduleStaleTimeout()andscheduleGarbageCollection()can be prevented from running by settingstaleandcachetoInfinity, butheal()will always call aclearTimeoutfunction.In our server environment calling
setTimeoutorclearTimeoutthrows an error.The fix is to add the
isServercheck to the if statement - I'm just not sure if there's any consequences to doing this? Does the server actually need to call any of these methods?