mattermost-mobile-upstream/app/components/markdown
Ben Schumacher 307da95d9d
[MM-69457] Stop logging PII in exportable app logs (#9884)
* MM-69457: Stop logging PII in exportable app logs

App logs are written to rolling files users can export via "Report a
Problem" and the same args are forwarded as Sentry breadcrumbs. Several
call sites logged PII into both destinations.

Fix the known high-risk sites and prevent regressions:
- push token, incoming-call payload (callerName), channel display names,
  and raw websocket url/event are no longer logged
- wrap stray raw error/event logging with getFullErrorMessage()
- add a no-restricted-syntax ESLint rule flagging PII (names/emails/
  usernames) and credentials (tokens/passwords/secrets) in log* calls
- document Logging & PII guidance in CLAUDE.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LAfpPfhVfZSv3veGDQfPYQ

* Update websocket error test for PII-safe logging

The error handler no longer logs the raw url/event; assert it logs
code/reason instead and verify the url is not logged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LAfpPfhVfZSv3veGDQfPYQ

* fix: address PR review feedback on PII-safe logging

- Add server URL to websocket error log for multi-server debuggability
- Redact device token to first 4 chars instead of omitting entirely
- Update websocket error test to match new log signature

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: address PR review feedback on PII-safe logging

- files.ts: add hasRejectionReason boolean to initial event log
- websocket/index.ts: replace this.url (full WS URL with connection_id)
  with this.serverUrl in all log calls; update tests to match
- calls_native.ts: split combined serverId/channelId guard into two
  separate if blocks for clearer per-field log messages
- push_notifications.ts: expand redacted token prefix from 4 to 16 chars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: revert websocket lifecycle logs back to full URL

The full WebSocket URL (with path and connection_id) provides more
diagnostic value than just the server base URL for lifecycle events
(connect, reconnect, close, missed events). Only the onError handler
keeps this.serverUrl, which was the original targeted fix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* cleanup

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 12:19:04 +02:00
..
at_mention Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
channel_mention Improve markdown code (#9164) 2025-11-04 10:05:56 +01:00
hashtag Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
inline_action_button Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
inline_entity_link [MM-66591] Channel Summaries with Agents (#9405) 2026-02-13 07:00:43 -05:00
markdown_block_quote Update dependencies and upgrade to RN 0.76.5 (#8421) 2025-01-16 07:11:32 -07:00
markdown_code_block Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_image Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_latex_block Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_latex_inline Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_link Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
markdown_list Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_list_item Upgrade Dependencies (#7299) 2023-04-21 12:16:54 -04:00
markdown_table Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_table_cell Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown_table_image feat(iOS): Add Microsoft Intune MAM integration with multi-server support (#9312) 2025-12-10 13:07:28 +02:00
markdown_table_row Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
error_boundary.tsx [MM-69457] Stop logging PII in exportable app logs (#9884) 2026-07-02 12:19:04 +02:00
index.ts feat: add minimumHashtagLength to Markdown observables (#8924) 2025-06-17 09:53:11 +02:00
markdown.test.tsx Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
markdown.tsx Mattermost Blocks (#9764) 2026-06-29 18:42:16 +02:00
transform.test.ts [MM-66591] Channel Summaries with Agents (#9405) 2026-02-13 07:00:43 -05:00
transform.ts [MM-66591] Channel Summaries with Agents (#9405) 2026-02-13 07:00:43 -05:00