Skip to content

Conversation

@thisisamir98
Copy link
Contributor

@thisisamir98 thisisamir98 commented Jan 5, 2026

BugWPB-22566 [Web] Schwarz - Asset Audit logs not enabled in production

Pull Request

Summary


Security Checklist (required)

  • External inputs are validated & sanitized on client and/or server where applicable.
  • API responses are validated; unexpected shapes are handled safely (fallbacks or errors).
  • No unsafe HTML is rendered; if unavoidable, sanitization is applied and documented where it happens.
  • Injection risks (XSS/SQL/command) are prevented via safe APIs and/or escaping.

Accessibility (required)

Standards Acknowledgement (required)

…et logging [WPB-22566] (#19971)

* fix: Use production url instead of environment variable to enable asset logging [WPB-22566]

* use backend rest

* change naming

* move isAuditLogEnabledForBackend
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR is a cherry-pick of #19971 that fixes asset audit logging configuration. The change replaces the use of environment variable (getWebEnvironment().isProduction) with a direct backend URL check to control whether asset logging is enabled. This ensures asset logging is disabled specifically on the wire.com cloud deployment while remaining enabled on other deployments (staging, internal, self-hosted), regardless of the webapp build type.

Key Changes:

  • Replaced environment-based check with backend URL comparison for controlling asset audit logging
  • Removed dependency on getWebEnvironment().isProduction for audit log decisions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/script/repositories/team/TeamState.ts Added static method isAuditLogEnabledForBackend() that checks if the backend URL is not the production cloud backend
src/script/repositories/conversation/MessageRepository.ts Updated asset logging logic to use new backend check and removed unused getWebEnvironment import

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.41%. Comparing base (7b724e2) to head (ad84f1f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20008      +/-   ##
==========================================
- Coverage   43.69%   43.41%   -0.28%     
==========================================
  Files        1309     1298      -11     
  Lines       32861    32634     -227     
  Branches     7286     7247      -39     
==========================================
- Hits        14359    14169     -190     
+ Misses      16778    16750      -28     
+ Partials     1724     1715       -9     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thisisamir98 thisisamir98 merged commit 8e4481a into master Jan 5, 2026
19 checks passed
@thisisamir98 thisisamir98 deleted the WPB-22566-2 branch January 5, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants