Shopify / Shopify/remote-dom

Node reordering with adapter throws an error

Open
#563 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
91
Avg merge
9d 14h
Merged PRs (30d)
38

Description

Reordering causes the node to get removed and then instantly re-inserted. When it's removed the listeners get instantly released which causes an error:

Uncaught Error: You attempted to call a function that was already released.

The receivers don't suffer from that as even listeners are leaking there.

Fixing https://github.com/Shopify/remote-dom/issues/562 will probably fix this issue but depending on the implementation might require some changes in the adapter.

A "fix" until then is to not release:

import {retain} from 'rpc_library';

function release() {}

const receiver = new SignalRemoteReceiver({retain, release});

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing node reordering with the adapter and inspect the SignalRemoteReceiver retain/release behavior described in the issue. Review issue #562 first, then determine how the adapter should handle removal followed by immediate reinsertion. Done means reordering no longer raises the released-function error without relying on the no-op release workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.