- Your Rocket.Chat Experimental app version: 4.2.4
- Your Rocket.Chat server version: 2.4.1
- Device (or Simulator) you're running with: iOS
App crashes when connecting to a RC server with URL contains subdirectory. (e.g. https://www.example.com/apps/chat)
I guess that DB.setShareDB() and DB.setActiveDB() in app/lib/database/index.js fails to replace URL to a path correcty in this case.
I haven't built and tested App, but I think it's better to add a global flag to the regular expression pattern parameter of replace function.
For example:
from const path = database.replace(/(^\w+:|^)\/\//, '').replace(/\//, '.');
to const path = database.replace(/(^\w+:|^)\/\//, '').replace(/\//g, '.');
Related old issue #1322
Thank you.