-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[WIP]feat: vault mode #7711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[WIP]feat: vault mode #7711
Conversation
Reviewer's Guide by SourceryThis pull request implements anonymous mode, allowing users to use the application without creating an account. It includes changes to authentication flow, data storage, and user onboarding. The local authentication type was removed, and the default user naming was updated. Sequence diagram for signing up as guestsequenceDiagram
participant FE as Frontend
participant AuthService
participant UserEventSignUp
participant UserProfilePB
FE->>AuthService: signUpAsGuest()
activate AuthService
AuthService->>UserEventSignUp: Send SignUpPayloadPB
activate UserEventSignUp
UserEventSignUp-->>AuthService: FlowyResult<UserProfilePB, FlowyError>
deactivate UserEventSignUp
AuthService-->>FE: FlowyResult<UserProfilePB, FlowyError>
deactivate AuthService
Updated class diagram for AppFlowyCoreConfigclassDiagram
class AppFlowyCoreConfig {
+String application_path
+String device_id
+String platform
+String log_filter
+AFCloudConfiguration cloud_config
+bool is_anon
}
note for AppFlowyCoreConfig "Added is_anon field to indicate anonymous mode"
Updated class diagram for AuthServiceclassDiagram
class AuthService {
<<interface>>
+Future~FlowyResult~UserProfilePB, FlowyError~~ signUpAsGuest(Map~String, String~ params)
}
note for AuthService "signUpAsGuest now returns Future<void>"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @appflowy - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a clear way to exit anonymous mode and transition to a registered account.
- Ensure the anonymous mode data is properly cleared when a user signs out or transitions to a full account.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
System::long_os_version(), | ||
platform | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider extracting the anonymous user logic into a dedicated helper method to simplify the conditional logic and reduce nesting depth, improving code clarity and maintainability
Consider extracting the anonymous user logic into a dedicated helper method to flatten the nested conditionals and reduce the temporary variables. For example:
async fn process_anon_user(&self, create: bool) -> FlowyResult<()> {
if create {
self.user_manager.create_anon_user_once().await
} else {
self.user_manager.active_anon_user().await
}
}
Then update your initialization block as follows:
let is_anon = config.is_anon;
let create_anon = is_anon && !Path::new(&config.storage_path).exists();
let this = Self::init(config, runtime).await;
if is_anon {
if let Err(err) = this.process_anon_user(create_anon).await {
error!("Anon user process failed: {}", err);
}
}
This refactoring isolates the anonymous user logic and reduces nested if
s while preserving all functionality.
🥷 Ninja i18n – 🛎️ Translations need to be updatedProject
|
lint rule | new reports | level | link |
---|---|---|---|
Missing translation | 29 | warning | contribute (via Fink 🐦) |
Enhancements:
Chores:
Summary by Sourcery
Implement anonymous mode for AppFlowy, allowing users to use the application without creating an account
New Features:
Enhancements:
Chores: