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

Delete account #1177

Merged
merged 14 commits into from
Aug 7, 2023
Merged

Delete account #1177

merged 14 commits into from
Aug 7, 2023

Conversation

Palakkgoyal
Copy link
Contributor

This PR closes #880
I have added delete account feature.
First I set up relative paths for settings page instead of absolute.
Fixed the CSS of settings page such that we just need to add css for the new page and don't need to worry about the sidebar and giving margin seperately for every settings page.
It was really typical to add delete account feature.
First of all I used batch to delete in sync. First I delete user doc and user posts then, user using auth from firebase and then cleanup for all the images whether it is background, profile or posts image.
The main problem was that to delete user it was necessary to have the user recently logged in. So, for that I set up auth.signInWithEmailAndPassword but, that was not working at all after so many trials. Then, I get to know that we need to reauthenticate the user but, the firebase docs didn't told how.
After spending about 5 hours the problem solved. XD

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Palakkgoyal! for creating this pull request and contributing to Dummygram! 💗

The maintainers will review this Pull Request and provide feedback as soon as possible! 😇
We appreciate your patience and contribution, Keep up the great work! 😀

@narayan954
Copy link
Owner

narayan954 commented Aug 7, 2023

This PR closes #880 I have added delete account feature. First I set up relative paths for settings page instead of absolute. Fixed the CSS of settings page such that we just need to add css for the new page and don't need to worry about the sidebar and giving margin seperately for every settings page. It was really typical to add delete account feature. First of all I used batch to delete in sync. First I delete user doc and user posts then, user using auth from firebase and then cleanup for all the images whether it is background, profile or posts image. The main problem was that to delete user it was necessary to have the user recently logged in. So, for that I set up auth.signInWithEmailAndPassword but, that was not working at all after so many trials. Then, I get to know that we need to reauthenticate the user but, the firebase docs didn't told how. After spending about 5 hours the problem solved. XD

omg, glad you could figure that out! and you also fixed the routes I'm guessing. I had assumed it to be a direct one click delete, but you improvised as well by providing a secure deletion. Thank you!
Will review this asap.

Copy link
Owner

@narayan954 narayan954 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed the oauth user deletion functionality which was missing here and added some TODOs (some are optional for now)
Also, I found, likes,comments didn't get deleted and cause app to crash when opening likes dialog box or show 404 when visiting the user profile. (maybe while fetching likes, it's not handling error like user not found)

@narayan954
Copy link
Owner

This PR closes #880 I have added delete account feature. First I set up relative paths for settings page instead of absolute. Fixed the CSS of settings page such that we just need to add css for the new page and don't need to worry about the sidebar and giving margin seperately for every settings page. It was really typical to add delete account feature. First of all I used batch to delete in sync. First I delete user doc and user posts then, user using auth from firebase and then cleanup for all the images whether it is background, profile or posts image. The main problem was that to delete user it was necessary to have the user recently logged in. So, for that I set up auth.signInWithEmailAndPassword but, that was not working at all after so many trials. Then, I get to know that we need to reauthenticate the user but, the firebase docs didn't told how. After spending about 5 hours the problem solved. XD

you're right about firebase docs, they're not comprehensive. I took help of source code to solve the oauth case of re authentication which they had provided no info about.

@Palakkgoyal
Copy link
Contributor Author

This PR closes #880 I have added delete account feature. First I set up relative paths for settings page instead of absolute. Fixed the CSS of settings page such that we just need to add css for the new page and don't need to worry about the sidebar and giving margin seperately for every settings page. It was really typical to add delete account feature. First of all I used batch to delete in sync. First I delete user doc and user posts then, user using auth from firebase and then cleanup for all the images whether it is background, profile or posts image. The main problem was that to delete user it was necessary to have the user recently logged in. So, for that I set up auth.signInWithEmailAndPassword but, that was not working at all after so many trials. Then, I get to know that we need to reauthenticate the user but, the firebase docs didn't told how. After spending about 5 hours the problem solved. XD

you're right about firebase docs, they're not comprehensive. I took help of source code to solve the oauth case of re authentication which they had provided no info about.

Take help of ChatGPT, it knows more than docs XD

@Palakkgoyal
Copy link
Contributor Author

I've fixed the oauth user deletion functionality which was missing here and added some TODOs (some are optional for now) Also, I found, likes,comments didn't get deleted and cause app to crash when opening likes dialog box or show 404 when visiting the user profile. (maybe while fetching likes, it's not handling error like user not found)

Actually I am getting quota exceeded error. So, I am not able to check for likes and comments.

@narayan954
Copy link
Owner

I've fixed the oauth user deletion functionality which was missing here and added some TODOs (some are optional for now) Also, I found, likes,comments didn't get deleted and cause app to crash when opening likes dialog box or show 404 when visiting the user profile. (maybe while fetching likes, it's not handling error like user not found)

Actually I am getting quota exceeded error. So, I am not able to check for likes and comments.

Yes, someone used the quota while testing stuffs ig . I used my own credentials to test.

@narayan954
Copy link
Owner

This PR closes #880 I have added delete account feature. First I set up relative paths for settings page instead of absolute. Fixed the CSS of settings page such that we just need to add css for the new page and don't need to worry about the sidebar and giving margin seperately for every settings page. It was really typical to add delete account feature. First of all I used batch to delete in sync. First I delete user doc and user posts then, user using auth from firebase and then cleanup for all the images whether it is background, profile or posts image. The main problem was that to delete user it was necessary to have the user recently logged in. So, for that I set up auth.signInWithEmailAndPassword but, that was not working at all after so many trials. Then, I get to know that we need to reauthenticate the user but, the firebase docs didn't told how. After spending about 5 hours the problem solved. XD

you're right about firebase docs, they're not comprehensive. I took help of source code to solve the oauth case of re authentication which they had provided no info about.

Take help of ChatGPT, it knows more than docs XD

yes I do, but for this I got too lazy and read the source XD

Copy link
Owner

@narayan954 narayan954 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@narayan954 narayan954 merged commit 95823c7 into narayan954:master Aug 7, 2023
2 of 4 checks passed
@Palakkgoyal Palakkgoyal deleted the deleteAccount branch August 8, 2023 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add delete account feature
2 participants