fix(portal-source): make pipe() id dedup stable for 3+ same-id transformers - #73
Open
iankressin wants to merge 1 commit into
Open
fix(portal-source): make pipe() id dedup stable for 3+ same-id transformers#73iankressin wants to merge 1 commit into
iankressin wants to merge 1 commit into
Conversation
…ormers The filter-then-count dedup compared each existing transformer's *current* id against the incoming base id, so once a transformer was renamed from `foo` to `foo 2` it fell out of the count. A third `foo` transformer then also got renamed to `foo 2`, colliding with the second. Replace with a uniqueness loop that keeps incrementing the suffix until the candidate id is unique across the whole transformer list. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a bug in PortalSource.pipe() where transformer ID deduplication became unstable once 3+ transformers shared the same base ID, causing collisions that could confuse profiling/logging.
Changes:
- Replace suffix assignment based on “count of exact-base-id matches” with a loop that finds the next unused suffixed ID across all existing transformers.
- Add a regression test ensuring 3+ same-base-id transformers end up with distinct, stable IDs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/subsquid-pipes/src/core/portal-source.ts |
Makes .pipe() transformer ID dedup stable by iterating suffixes until an unused ID is found. |
packages/subsquid-pipes/src/core/portal-source.test.ts |
Adds a regression test covering 4 transformers sharing the same base ID and asserting unique final IDs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mo4islona
force-pushed
the
design/sdk1
branch
2 times, most recently
from
May 8, 2026 23:50
b255ea5 to
b75360a
Compare
An error occurred while trying to automatically change base from
design/sdk1
to
main
July 2, 2026 11:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
.pipe()deduped ids by counting existing transformers whoseid()still equals the incoming base id. After the 2nd rename, that count stopped growing, so the 3rd+ transformer collided with the 2nd.Test plan
pnpm vitest run src/core/portal-source.test.tsfrompackages/subsquid-pipes/