Skip to content

fix(devtool): recover when app sinks arrive late - #1031

Open
jamilahmadzai wants to merge 1 commit into
cyclejs:masterfrom
jamilahmadzai:fix/devtool-delayed-sinks-436
Open

fix(devtool): recover when app sinks arrive late#1031
jamilahmadzai wants to merge 1 commit into
cyclejs:masterfrom
jamilahmadzai:fix/devtool-delayed-sinks-436

Conversation

@jamilahmadzai

Copy link
Copy Markdown

Fixes #436.

What changed

  • Keep the DevTool's initial no-app state from permanently marking graph serialization as started.
  • Allow the later @cycle/run hook to provide compatible xstream sinks after the inspected app finishes booting.
  • Suppress repeated invalid-state emissions while still ignoring all calls after a valid graph has started.
  • Isolate the startup decision and cover invalid, repeated-invalid, delayed-valid, and already-started transitions with a regression test.

Root cause

The extension probes the inspected page after 50 ms. When the app has not exposed sinks yet, that probe starts the serializer with null and sets the global started flag. The later call from @cycle/run then returns early even though it contains the real app sinks.

User impact

Apps that initialize after the extension's first probe can now replace the initial no-app state with their actual dataflow graph. Existing behavior is preserved for incompatible sinks, repeated probes, and serializers that have already started successfully.

Validation

  • npm --prefix devtool run test-ci — passes
  • git diff --check — passes

The DevTool's full legacy lint and TypeScript build remain blocked by pre-existing violations and dependency declaration incompatibilities in the package. The new helper itself compiles under the repository's pinned TypeScript 3.2.4 compiler, and it introduces no new lint findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DevTool doesn't recognize app as being Cyclejs

1 participant