Thanks to visit codestin.com
Credit goes to github.com

Skip to content

regression: Navigation issues after upgrading to react-navigation 7 #6492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 61 commits into from
Jul 17, 2025

Conversation

diegolmello
Copy link
Member

@diegolmello diegolmello commented Jul 14, 2025

Proposed changes

Since we upgraded to react-navigation 7 and it had several breaking changes, tablets weren't working properly and sometimes RoomView could be instantiated more than once on mobile, which is wrong.
I've reviewed all navigation changes to RoomView and leaving RoomView and made the necessary changes to cover both mobile and tablet.

Here are the events I reviewed:

  • Mark message as unread
  • Mark thread as unread
  • User deletes a room/team
  • User is removed from a room/team (while the room is open)
  • Leave room/team
  • Go to message from in-app notification
  • Go to thread from ThreadMessagesView
  • Go to message from search
  • Go to message from Mentions/Starred/Pinned
  • Go to discussion from DiscussionsView/message
  • Go to room from RoomInfo (Message)
  • Omni
  • Go to thread from message
  • Push notification deep link
  • Create channel
  • Directory

It also removes the window logic from subscriptions/room mentioned in #6057.
It's a potential fix for it.
It may need a separate PR, but it's ok to merge it here until we decide otherwise.

Issue(s)

Relates to #6057
https://rocketchat.atlassian.net/browse/NATIVE-936

How to test or reproduce

// post-message.js
function postMessage() {
  const url = 'https://' + host + '/api/v1/chat.postMessage';
  const response = http.post(url, {
    headers: { 
      'Content-Type': 'application/json', 
      'x-auth-token': token, 
      'x-user-id': userId
    },
    body: JSON.stringify(
      {
        roomId: rid,
        text: msg
      }
    )
  });

  console.log('response', response.body);

  output.messageId = JSON.parse(response.body).message._id;

  return response.ok;
}

postMessage();
# message-in-background.yml
appId: chat.rocket.reactnative
env:
  host: HOST
  rid: RID
  token: TOKEN
  userId: USER_ID
---
- evalScript: ${output.counter = 0}
- repeat:
    times: 50
    commands:
      - pressKey: home
      - evalScript: ${output.counter = output.counter + 1}
      - evalScript: ${output.msg = 'test' + output.counter}
      - runScript:
          file: ../scripts/post-message.js
          env:
            msg: ${output.msg}
            token: ${token}
            userId: ${userId}
            rid: ${rid}
            host: ${host}
      - openLink: ${'rocketchat://room?host=' + host + '&rid=' + rid + '&messageId=' + output.messageId}
      - assertWithAI:
          assertion: ${output.msg} is visible.

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

@diegolmello diegolmello force-pushed the fix.react-navigation-7-fixes branch from 2c4b19e to 6abe582 Compare July 14, 2025 21:05
@diegolmello diegolmello marked this pull request as ready for review July 16, 2025 13:27
Copy link
Contributor

@OtavioStasiak OtavioStasiak left a comment

Choose a reason for hiding this comment

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

looks good to me!

@diegolmello diegolmello merged commit cb52219 into develop Jul 17, 2025
5 of 7 checks passed
@diegolmello diegolmello deleted the fix.react-navigation-7-fixes branch July 17, 2025 13:41
@diegolmello diegolmello temporarily deployed to experimental_android_build July 17, 2025 13:43 — with GitHub Actions Inactive
@diegolmello diegolmello temporarily deployed to official_ios_build July 17, 2025 13:43 — with GitHub Actions Inactive
@diegolmello diegolmello temporarily deployed to experimental_ios_build July 17, 2025 13:43 — with GitHub Actions Inactive
@diegolmello diegolmello temporarily deployed to official_android_build July 17, 2025 13:43 — with GitHub Actions Inactive
@diegolmello diegolmello temporarily deployed to upload_experimental_android July 17, 2025 14:11 — with GitHub Actions Inactive
Copy link

Android Build Available

Rocket.Chat Experimental 4.63.0.87758

Internal App Sharing: https://play.google.com/apps/test/RQVpXLytHNc/ahAO29uNQz3pf48W8HBzOt5uTC-XQtRFmMFcsfzjop7ojM4t2cZ5jhJ0enRftASc13XbrDW0mLjU5a-vzYthMxUbrh

Copy link

Android Build Available

Rocket.Chat Experimental 4.63.0.

@Rohit3523
Copy link
Collaborator

It's working 🫣

Yeahhhh 😍

@diegolmello diegolmello temporarily deployed to upload_official_android July 17, 2025 14:37 — with GitHub Actions Inactive
Copy link

Copy link

iOS Build Available

Rocket.Chat Experimental 4.63.0.87758

Copy link

Android Build Available

Rocket.Chat 4.63.0.

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.

3 participants