Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1152

Reconstruct app url after a migration

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sync
    • Labels:
      None

      To be able to write e2e tests for this feature, we'll need to wait for BAAS-13163 to be released.

      With BAAS-11596, customers will be able to change the deployment model and/or region of their apps.

      The Realm SDK team will need to add retry logic on the client URLs to reconstruct the correct URL once the migration is over. This will lead to a better user experience, especially for mobile developers.

      • If a client request performed within the SDKs returns a 301 (Moved Permanently) error code, the SDKs will need to re-execute the request with the new location. The server will generate a "Location" header field in the response containing the new location.

      For example, if an app is migrated from AWS us-west-2 to GCP western-us, the app's base url would change from https://us-east-1.aws.realm.mongodb.com to https://western-us.gcp.realm.mongodb.com after the migration. The /location endpoint will also provide the updated base url.

      • Sample request:
        GET https://us-west-2.aws.realm.mongodb.com/api/client/v2.0/app/<client-id>/auth/providers/anon-user/login
      • Sample response:
        301 Moved Permanently
        Location: https://us-east-1.aws.realm.mongodb.com/api/client/v2.0/app/<client-id>/auth/providers/anon-user/login

      Based on some conversations I had with the SDK team, I believe there will be some work for the web sdk (js) as well.

            Assignee:
            michael.wilkersonbarker@mongodb.com Michael Wilkerson-Barker
            Reporter:
            andrea.rahmanan@mongodb.com Andrea Rahmanan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: