fix: prevent error and aborted XHR on export notification click#69
Merged
fix: prevent error and aborted XHR on export notification click#69
Conversation
The export notification href was a full external URL, causing the browser to navigate away on click. This aborted the concurrent mark-as-read XHR (status 0 / NS_BINDING_ABORTED), surfacing a spurious error dialog. Override href() to return '#' to prevent page navigation, and override markAsRead() to open the download via window.open(_blank) instead. The mark-as-read XHR then completes cleanly without being aborted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
68c133e to
05f4d57
Compare
Merged
7 tasks
imorland
added a commit
that referenced
this pull request
Mar 3, 2026
…rt (#4396) * [2.x] feat(gdpr): PII field declarations, anonymized context support, and user column overview (#65, #67, #68, #69) Port #65, #67, #68, #69 from the standalone 1.x repo to the 2.x monorepo. - Add `piiFields(): array` to `DataType` interface and `Type` base class; implement on `User`, `Posts`, `Tokens` - `DataProcessor::getPiiKeysForSerialization()` aggregates PII fields from all registered types plus extras - `DataProcessor::getPiiKeysWithExtensions()` builds a unified key→extensionId map (type-declared wins over extras) - `DataProcessor::$removeUserColumns` refactored from `string[]` to `array<string, string|null>` (column→extensionId map); add `removableUserColumnsWithExtensions()` and `resetRemovableUserColumns()` - `UserData` extender gains `addPiiKeysForSerialization()` and passes extensionId to `removeUserColumns()` - `DataTypeResource` `user-columns` endpoint now returns `piiKeys`, `piiKeyExtensions`, `removableColumns` (as map), `allColumns` - Admin `GdprPage` user table section fully implemented with 6-column grid (Column, Type, Nullable, PII, Redacted on export, Extension); uses `Icon` component (2.x) - `Exporter` guards against `null` return from `DataType::export()` - `ExportAvailableNotification` opens download in new tab via `markAsRead()` to prevent XHR abort - `User::piiFields()` expanded to include `nickname`, `suspend_reason`, `suspend_message` - Add `flarum-gdpr.lib.data.default_user_action` locale key; add 10 user table column UI keys - README: fix `Blomstra\` → `Flarum\` namespace references; add PII fields and anonymized contexts developer docs - Tests: 6 new integration tests (`ListUserColumnsDataControllerTest`), 7 new unit tests (`DataProcessorTest`), 4 new unit tests (`TypeTest`), 4 new integration tests (`ExtenderTest`) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Apply fixes from StyleCI * fix(gdpr): add PHPStan type annotations to resolve array_values template type Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(gdpr): restore Form layout, fix customSetting JSX and type:text for admin settings page - Restore Form/Form-group/label structure in GdprPage (accidentally replaced with h3/hr layout following 1.x diff too closely) - Keep grid() as separate method, add userColumnTable() alongside it - Use customSetting() for the GDPR page link (JSX cannot be passed to setting()) - Fix default-anonymous-username type: 'string' → 'text' (unknown type rendered a bare input with no label) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: StyleCI Bot <bot@styleci.io>
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
://so theLinkcomponent rendered a plain<a>tag)POST /api/notifications/:idXHR with status0(NS_BINDING_ABORTED), causing a spurious "oops something went wrong" error dialogview()to intercept the click withe.preventDefault(), then trigger the download viawindow.open(..., '_blank')so the current page is not navigated away from and the XHR completes cleanly.ts→.tsxto support JSX in the overriddenview()Test plan
🤖 Generated with Claude Code