Skip to content

Provisioned sync fails on matrix.org: password change disabled, infinite spinner on desktop #3263

Description

@overcuriousity

Hey there,

I tried to set up matrix sync, as synchronization between my devices would be a critical feature for me. It seems to only support matrix as a sync option, and as the docs were not exactly clear how to set it up, i let claude explain.
Following the steps, I ran into issues which are caused by incompatibility with the standard matrix.org homeserver. Also i failed to find an option to change the homeserver.

I would suggest adding a more general sync option like syncthing or file based sync like webdav/nextcloud.

Nonetheless, here is a bug report claude was kind enough to create for me, regarding the matrix issues:

Summary

Setting up sync using an existing matrix.org account fails with two bugs:

  1. Android shows "Configuration failed" — matrix.org has disabled /_matrix/client/v3/account/password (returns M_UNRECOGNIZED). The Matrix SDK throws when it tries to rotate the password after joining the room, which lands in the outer catch block and surfaces as a generic configuration error.

  2. Desktop shows infinite bare spinner — when provisioning completes (or fails) before the WoltModalSheet has finished mounting the config page (page index 1), the finally { link.close() } in configureFromBundle releases the keepAlive link. Riverpod auto-disposes the provider, and when page 1 mounts it gets a fresh initial state (bare CircularProgressIndicator with no label or progress bar) rather than the terminal state.

Steps to reproduce

  1. Create a dedicated Matrix account on matrix.org
  2. Use the tools/matrix_setup script (or craft a bundle manually) to create a sync room under that account
  3. Paste the bundle string into Settings → Sync → Provisioned Sync → Configure
  4. Android: see "Configuration failed" after a short delay
  5. Desktop: see a bare loading spinner that never resolves

Root causes

Bug 1 (provisioning_controller.dart, configureFromBundle):

await matrixService.changePassword(
  oldPassword: bundle.password,
  newPassword: newPassword,
);

matrix.org returns M_UNRECOGNIZED for this endpoint. The exception propagates to the outer catch and sets ProvisioningError.configurationError, even though login and room join already succeeded.

Bug 2 (provisioning_controller.dart, configureFromBundle):

} finally {
  link.close();  // closes too early if provisioning finishes before page 1 mounts
}

Suggested fix

Bug 1: Wrap changePassword in its own try/catch and fall back to the original password for the handover bundle on failure. The sync room is encrypted and functional regardless of whether the password was rotated.

Bug 2: Hold the keepAlive link as a field (KeepAliveLink? _keepAliveLink) and release it in reset() (called when the modal closes) rather than in a finally block.

Verified

  • matrix.org returns M_UNRECOGNIZED on POST /_matrix/client/v3/account/password (tested with curl against matrix-client.matrix.org)
  • Code paths confirmed by reading provisioning_controller.dart, provisioned_config_page.dart, and matrix_sdk_gateway.dart

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions