endimonan opened a new pull request, #45463:
URL: https://github.com/apache/superset/pull/45463

   ### SUMMARY
   
   Fixes #45384.
   
   Dashboard reports can ignore configured native filters when a value such as 
`Company 2` needs Rison quotes. The report model replaces those quotes with 
`%27`, then the permalink redirect URL-encodes them again. After the browser 
decodes the URL, the remaining `%27` makes the filter state invalid.
   
   Return raw Rison from the report model and let the existing permalink 
redirect encode it once. Add regression coverage for spaces, apostrophes, 
Unicode, URL delimiters and literal percent sequences, including reports with 
tabs disabled, no selected tab, one tab and multiple tabs.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Before: the generated dashboard URL contains double-encoded Rison quotes 
(`%2527`), and configured filters fail to decode.
   
   After: one URL decode produces valid Rison with the original filter values. 
Other query parameters and selected tab anchors are preserved.
   
   ### TESTING INSTRUCTIONS
   
   - Reproduced before the fix: 8 regression cases failed, 37 tests passed.
   - After the fix: all 540 tests passed across 
`tests/unit_tests/reports/model_test.py`, 
`tests/unit_tests/commands/report/test_native_filter_urls.py` and 
`tests/unit_tests/commands/report/execute_test.py`.
   - Changed-file pre-commit passed, including mypy, Ruff and pylint.
   - The regression tests exercise the report model, report URL generation and 
the actual permalink redirect; permalink storage and authorization are mocked. 
SMTP delivery and browser screenshot capture were not exercised locally.
   
   Manual verification: enable `ALERT_REPORTS`, `ALERT_REPORTS_FILTER` and, for 
tabbed reports, `ALERT_REPORT_TABS`. Configure a dashboard report with a filter 
value containing a space or apostrophe, such as `Company 2` or `O'Brien`. Run 
the report and compare its PNG/PDF against the dashboard with the same filter 
applied. Repeat for a selected tab and multiple tabs.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: #45384
   - [x] Required feature flags: `ALERT_REPORTS`, `ALERT_REPORTS_FILTER`; 
`ALERT_REPORT_TABS` for selected tabs
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to