Skip to content

chore: Merge 4.67.1 into single-server#6829

Merged
diegolmello merged 4 commits intosingle-serverfrom
4.67.1
Dec 2, 2025
Merged

chore: Merge 4.67.1 into single-server#6829
diegolmello merged 4 commits intosingle-serverfrom
4.67.1

Conversation

@diegolmello
Copy link
Member

@diegolmello diegolmello commented Dec 2, 2025

Proposed changes

Issue(s)

https://rocketchat.atlassian.net/browse/NATIVE-1099

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • Version

    • Updated to 4.67.1
  • Bug Fixes

    • Enhanced notification delivery reliability and error handling
    • Improved notification processing to handle edge cases and initialization delays
    • Strengthened encryption mechanisms for file message attachments
    • Better error recovery in notification display and fallback scenarios

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This patch release (4.67.0 → 4.67.1) bumps version metadata across Android, iOS, and package.json. Concurrently, the Android notification system is refactored with enhanced concurrency safety via volatile references and ConcurrentHashMap, comprehensive error handling with retry/timeout logic, verbose diagnostic logging, and improved E2E message handling paths.

Changes

Cohort / File(s) Summary
Version Bumps
android/app/build.gradle, ios/RocketChatRN.xcodeproj/project.pbxproj, ios/RocketChatRN/Info.plist, ios/ShareRocketChatRN/Info.plist, package.json
Version string updated from 4.67.0 to 4.67.1 across Android, iOS, and package manifests.
Android Notification System Overhaul
android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java
Added verbose logging toggle (ENABLE_VERBOSE_LOGS), made ReactApplicationContext volatile for thread-safety, changed notificationMessages to ConcurrentHashMap. Reworked onReceived to validate notId and wait for React initialization with timeout. Introduced handleNotification(), loadNotificationAndProcess(), and processNotification() methods for improved async flow. Enhanced E2E handling with fast/slow paths, sanitized logging around avatar and networked data, and defensive try-catch blocks throughout.
Android Notification Loading
android/app/src/main/java/chat/rocket/reactnative/notification/LoadNotification.java
Added comprehensive input validation, configured OkHttpClient with timeouts (connect 10s, read 30s, write 30s), and endpoint URL parsing with safety checks. Introduced retry mechanism via handleRetryOrFailure helper. Expanded runRequest with status code handling, JSON parsing via Gson, response validation, and error categorization (authentication/server/generic HTTP errors). Enhanced data model with additional payload fields (senderName, msg, tmid) and nested Content class for encryption metadata.
Android Notification Token/User Retrieval
android/app/src/main/java/chat/rocket/reactnative/notification/Ejson.java
Made ensureMMKVInitialized() synchronized. Enhanced getAvatarUri(), token(), and userId() methods with null/empty checks, debug logging, and key-based MMKV lookups. Added defensive returns and diagnostic logging for MMKV state and missing credentials.
Android Notification Utilities
android/app/src/main/java/chat/rocket/reactnative/notification/NotificationHelper.java
Added new utility class with sanitizeUrl(String) method that normalizes URLs for logging—returning "[null]" for null input, full URL in debug builds, and "[workspace]" in production.
Android Notification Reply
android/app/src/main/java/chat/rocket/reactnative/notification/ReplyBroadcast.java
Wrapped notId parsing in try-catch for NumberFormatException with error logging; gracefully skips replyToMessage on parse failure.
E2E Encryption Message Handling
app/lib/encryption/room.ts
Removed IUpload type from exports. Updated encrypt() to construct explicit encryptedMessage, delete msg field from result, and return transformed object on success. Removed EncryptUpload functionality.
E2E File Message Transmission
app/lib/methods/sendFileMessage/sendFileMessageV2.ts
Updated rooms.mediaConfirm payload to conditionally set msg to undefined when content exists (omitting msg field), falling back to file.msg otherwise. Always includes content property when available.

Sequence Diagram(s)

sequenceDiagram
    participant App as Android App
    participant CNS as CustomPushNotification
    participant React as React Context
    participant LN as LoadNotification
    participant Server as Server
    participant E2E as E2E Decryption

    App->>CNS: onReceived(Ejson)
    activate CNS
    
    Note over CNS: Validate notId
    alt React not initialized
        CNS->>CNS: Spawn background thread
        CNS->>React: Wait for init (timeout)
    end
    
    alt Message ID only
        CNS->>LN: loadNotificationAndProcess()
        activate LN
        LN->>Server: GET push.get (with retry/timeout)
        Server-->>LN: Full notification payload
        LN->>CNS: Callback with loaded Bundle
        deactivate LN
    else Full message received
        Note over CNS: Proceed with available data
    end
    
    CNS->>CNS: processNotification()
    
    alt E2E encrypted
        alt React context available (fast path)
            CNS->>E2E: Decrypt immediately
            E2E-->>CNS: Decrypted content
        else Async processing (slow path)
            CNS->>E2E: Schedule async decryption
            E2E-->>CNS: Callback with decrypted content
        end
    end
    
    CNS->>CNS: showNotification()
    Note over CNS: Log avatar, build notification
    CNS->>App: Display notification
    
    deactivate CNS
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • CustomPushNotification.java: Thread-safety semantics (volatile context, ConcurrentHashMap), async initialization flow with timeout, dual E2E decryption paths, and pervasive error handling require careful validation
  • LoadNotification.java: New retry mechanism, timeout logic, OkHttpClient configuration, response parsing, and error categorization need scrutiny to ensure robustness
  • Ejson.java: Synchronized ensureMMKVInitialized() and MMKV lookup logic with fallbacks warrant concurrency and state-consistency review
  • E2E encryption changes (room.ts, sendFileMessageV2.ts): Behavior change to omit msg field when content exists must be validated against downstream consumers and protocol expectations
  • Integration risk: Interaction between async notification loading, E2E decryption, and React initialization timing could introduce race conditions or state inconsistencies

Possibly related PRs

Suggested reviewers

  • OtavioStasiak

Poem

🐰 A whisper through the warren keen,
Version bumped and logs now clean—
Thread-safe hops and retries bright,
E2E secrets sealed up tight,
Notifications bloom with care,
Swift delivery everywhere! 🚀

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 4.67.1

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b5f7a03 and 66a2b06.

📒 Files selected for processing (12)
  • android/app/build.gradle (1 hunks)
  • android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java (10 hunks)
  • android/app/src/main/java/chat/rocket/reactnative/notification/Ejson.java (4 hunks)
  • android/app/src/main/java/chat/rocket/reactnative/notification/LoadNotification.java (3 hunks)
  • android/app/src/main/java/chat/rocket/reactnative/notification/NotificationHelper.java (1 hunks)
  • android/app/src/main/java/chat/rocket/reactnative/notification/ReplyBroadcast.java (1 hunks)
  • app/lib/encryption/room.ts (1 hunks)
  • app/lib/methods/sendFileMessage/sendFileMessageV2.ts (1 hunks)
  • ios/RocketChatRN.xcodeproj/project.pbxproj (2 hunks)
  • ios/RocketChatRN/Info.plist (1 hunks)
  • ios/ShareRocketChatRN/Info.plist (1 hunks)
  • package.json (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@diegolmello diegolmello merged commit c9b0df2 into single-server Dec 2, 2025
17 of 22 checks passed
@diegolmello diegolmello deleted the 4.67.1 branch December 2, 2025 12:37
@diegolmello diegolmello had a problem deploying to experimental_ios_build December 2, 2025 12:37 — with GitHub Actions Failure
@diegolmello diegolmello had a problem deploying to experimental_android_build December 2, 2025 12:37 — with GitHub Actions Failure
@diegolmello diegolmello had a problem deploying to official_android_build December 2, 2025 12:37 — with GitHub Actions Failure
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.

1 participant