Skip to content
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

[Plugin][Feature] Feature delete account #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

starjustice
Copy link
Collaborator

@starjustice starjustice commented May 7, 2024

Type of PR

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • πŸ§™β€β™‚οΈ New feature (adding a feature following a feature-request issue)
  • πŸ”¨ Improvement (improving an existing feature - includes style: and perf:commits)
  • πŸ—οΈ Refactor (rewriting existing code without any feature change)
  • ✍️ (!) This change is or requires a documentation update

Description

This pull request contains a new feature to delete a user using the Lexicon plugin, enabling user deletion from the Lexicon mobile app.

Here flow how controller work

flowchart
	n1[/"Password"/]
    n3{"is admin?"}
	n1[/"password"/] --- n2{"is password correct?"}
	n2 -- yes --> n3
    n2 -- no --> n4["throw error password"]
    n3 -- no --> n5["Delete All post"]
    n5 --- n10["delete all push notification plugin data"]
    n3 -- yes --> n9["throw error cannot delete admin"]
	n10 --- n6["Delete user"]
	n7("Start")
    n7 --- n1
    n6 --- n8("end")
Loading

Changes

Date: Tue, 7 May 2024

Contextual Changes:

  • Create new controller for delete user config/routes.rb, app/controllers/discourse_lexicon_plugin/delete_user_controller.rb
  • Create custom class lib/discourse-lexicon-plugin/user_destroyer.rb and lib/discourse-lexicon-plugin/post_destroyer.rb
  • Change default route lexicon/push_notifications into lexicon lib/discourse-lexicon-plugin/engine.rb
Date: Thu, 16 May 2024

Contextual Changes:

  • Create new class for delete data push notifications app/services/push_notification_cleanup.rb
  • Adjust delete user controller to add delete push notifications data app/controllers/discourse_lexicon_plugin/delete_user_controller.rb

Additional Screenshots

Delete user database
Before After
image image
image
image
image
Message image image image

Additional information/context

Delete Post

Normal delete post using admin

id user_id topic_id post_number raw cooked created_at updated_at reply_to_post_number reply_count quote_count deleted_at off_topic_count like_count incoming_link_count bookmark_count score reads post_type sort_order last_editor_id hidden hidden_reason_id notify_moderators_count spam_count illegal_count inappropriate_count last_version_at user_deleted reply_to_user_id percent_rank notify_user_count like_score deleted_by_id edit_reason word_count version cook_method wiki baked_at baked_version hidden_at self_edits reply_quoted via_email raw_email public_version action_code locked_by_id image_upload_id outbound_message_id
51 15 47 1 create post for test 13 create post for test 13 2024-05-06 06:14:31.269753 2024-05-06 06:14:31.269753 NULL 0 0 2024-05-06 06:14:47.508977 0 0 0 0 0.2 1 1 1 15 false NULL 0 0 0 0 2024-05-06 06:14:31.278476 false NULL 0 0 0 1 NULL 5 1 1 false 2024-05-06 06:14:31.269726 2 NULL 0 false false NULL 1 NULL NULL NULL NULL

Using API Plugin

id user_id topic_id post_number raw cooked created_at updated_at reply_to_post_number reply_count quote_count deleted_at off_topic_count like_count incoming_link_count bookmark_count score reads post_type sort_order last_editor_id hidden hidden_reason_id notify_moderators_count spam_count illegal_count inappropriate_count last_version_at user_deleted reply_to_user_id percent_rank notify_user_count like_score deleted_by_id edit_reason word_count version cook_method wiki baked_at baked_version hidden_at self_edits reply_quoted via_email raw_email public_version action_code locked_by_id image_upload_id outbound_message_id
52 15 48 1 delete using API in here delete using API in here 2024-05-06 07:00:28.89479 2024-05-06 07:00:28.89479 NULL 0 0 2024-05-06 07:01:14.41645 0 0 0 0 NULL 1 1 1 15 false NULL 0 0 0 0 2024-05-06 07:00:28.904147 false NULL 1 0 0 15 NULL 5 1 1 false 2024-05-06 07:00:28.894756 2 NULL 0 false false NULL 1 NULL NULL NULL NULL

Need to do implement class overridden in ruby for user_destroyer and post_destroyer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant