Create DEFAULT_QUEUE when FileQueueService is created #1094
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This issue occurs due to a computation being rendered before a dependency of that computation is updated – during the same render pass.
In this case:
This is sometimes called a "backtracking re-render". Further reading:
Partial fix
A workaround to prevent this issue for the DEFAULT_QUEUE is to create it early, before the render pass.
However, with a named queue this would need to be done by consumers in their own app code. A demonstration of this has been added as a test.
Probably, some documentation should be updated to warn about this.
Considerations
This is only a partial fix. As a breaking change we might want to restrict the
fileQueue
helper to only being able find queues, and not create them.That would mean users should create any named queues explicity in their own app code outside of rendering. This is a minor limitation, but I think it might be a better design since it suggests using autotracking in a more conventional way. Users would still be able to create dynamically named queues if they wanted, thought that's probably rare.
Partially fixes #1085