Skip to content

Instantly share code, notes, and snippets.

@bendk
Created July 6, 2023 21:12
Show Gist options
  • Save bendk/967889cbc48b012502a3ebcf7b0fc3a5 to your computer and use it in GitHub Desktop.
Save bendk/967889cbc48b012502a3ebcf7b0fc3a5 to your computer and use it in GitHub Desktop.

FxAccountConfig.swift

  • FxAConfig and Server: I think we can start using the Rust versions of these rather than the wrapped ones

FxAccountDeviceConstellation.swift

  • constellationStateUpdate: applications can use register_event_listener and listen for the FxaEvent::DeviceListChanged event instead.

  • ConstellationState: DeviceList can replace this

  • DeviceConstellation: FirefoxAccount can now handle all of this functionality. I'm not sure if we need a separate class for this anymore. If so, maybe the class should be defined in firefox-ios.

    • state: FirefoxAccount::get_device_list() can be used instead
    • refreshState: FirefoxAccount::refesh_device_list() can be used instead
    • setLocalDeviceName: FirefoxAccount::set_device_name() can be used instead
    • sendEventToDevice: FirefoxAccount::send_single_tab() can be used instead
    • setDevicePushSubscription: FirefoxAccount::set_push_subscription() can be used instead
    • handlePushMessage: FirefoxAccount::process_push_message() can be used instead

FxAccountManager.swift

  • accountAuthenticated and accountProfileUpdate: applications can use register_event_listener() and listen for the AuthStateChange and ProfileUpdate events instead

  • accountMigrationFailed: I think this is gone now that Mark deleted the migration code

  • FxAccountManager: most of this is a already thin wrapper around FirefoxAccount, but some of the methods can now use the new functionality. I also think this can be merged with the PersistedFirefoxAccount class. ITSM that we don't need 2 different wrapper classes for this.

    • The accountStorage field may be able to be replaced or refactored with the new register_storage_handler() method. I haven't looked at the swift code too deeply here though.

    • constructor: can call FirefoxAccount::new_uninitialized instead rather than having a nullable inner account

    • initialize: can now call FirefoxAccount::initialize()

    • hasAccount: FirefoxAccount::get_auth_state() can replace this

    • accountNeedsReauth: FirefoxAccount::get_auth_state() can replace this

    • resetPersistedAccount: a function that resets the inner Persisted Account based on the persisted state

      • iOS references:
        • called in BrowserViewController.dequeueQueuedTabs function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment