Uploaded image for project: 'Realm Dart SDK'
  1. Realm Dart SDK
  2. RDART-853

Investigate user state change notifications

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      JS has something like this

      currentUser.addListener(handleUserEventChange);
      
      const handleUserEventChange = () => {
        if (currentUser) {
          if (originalAccessToken !== currentUser.accessToken) {
            originalAccessToken = currentUser.accessToken;
          }
          switch (currentUser.state) {
            // @ts-expect-error
            case "LoggedIn": // Bug to be fixed: Literal is documented as 'active'
            // @ts-expect-error
            case 'LoggedOut': // Bug to be fixed: Literal is documented as 'logged-out'
              Logger.info(`User (id: ${currentUser.id}) has been logged out.`);
              resetUser();
            // break;
            // @ts-expect-error
            case 'Removed': // Bug to be fixed: Literal is documented as 'removed'
              Logger.info(`User (id: ${currentUser.id}) has been removed from the app.`);
              resetUser();
            default:
              break;
          }
        }
      };
      

      Consider adding a change stream in Dart for user state changesd

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: