Skip to content

fix(pipe): stop mask pipe from leaking config between calls - #1670

Open
endlacer wants to merge 1 commit into
NepipenkoIgor:developfrom
endlacer:feature/1669-fix-pipe-order
Open

endlacer wants to merge 1 commit into
NepipenkoIgor:developfrom
endlacer:feature/1669-fix-pipe-order

Conversation

@endlacer

@endlacer endlacer commented Sep 30, 2026 •

Copy link
Copy Markdown

fixes 1669

@NepipenkoIgor NepipenkoIgor left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, @endlacer! Verified locally on top of develop: the full lib suite is green (905 tests) and 4 of the 5 new tests fail against the old pipe, so they do cover #1669. A per-pipe NgxMaskService with patterns merged from the provided defaults is the right approach.

Two requests before merge:

  1. Please move the tests into mask.pipe.spec.ts as a nested describe('config isolation (#1669)') and drop issue-1669.spec.ts. Pipe regressions belong with the other pipe tests (#1567 and #1492 are already there), and that file has the TestBed setup that createPipe duplicates. The existing issue-NNNN.spec.ts files are a pattern we want to move away from, so please don't add to it.

  2. One leak of the same kind remains on a single pipe instance:

    pipe.transform('12', '00');                                              // '12'
    pipe.transform('12', '00', { patterns: { '0': { pattern: /[a-z]/ } } }); // '12', expected ''

    applyMask (ngx-mask.service.ts:311-322) still sees currentValue from the previous call and returns the input unmasked. It pre-dates this PR, so say if you'd rather leave it for a follow-up, but resetting the per-call service state at the top of transform plus a test would close the issue properly.

No need to touch the version or CHANGELOG.md, we'll handle that at release.

@endlacer
endlacer force-pushed the feature/1669-fix-pipe-order branch from fce4bbd to 6412554 Compare October 8, 2026 15:19
@endlacer
endlacer requested a review from NepipenkoIgor October 8, 2026 19:28

This branch has not been deployed

No deployments
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.

mask pipe: custom patterns leak into later pipe calls

2 participants