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

Deleting channels creates orphans records #70

Closed
4www opened this issue Sep 2, 2017 · 4 comments
Closed

Deleting channels creates orphans records #70

4www opened this issue Sep 2, 2017 · 4 comments
Assignees
Labels

Comments

@4www
Copy link
Contributor

4www commented Sep 2, 2017

When a user decides to delete their channel, it creates orphan records of two types:

  • channel, in other user's channel.favoriteChannels
  • tracks, all tracks from the now deleted channels have not been deleted

There is therefore some errors when loading a channel that has favorite that do no longer not exist

@oskarrough oskarrough added the bug label Sep 3, 2017
@oskarrough oskarrough self-assigned this Oct 9, 2017
@oskarrough
Copy link
Member

We do remove the channel everywhere it is favorited here https://github.com/internet4000/radio4000/blob/master/app/channel/delete/controller.js#L45

But tracks we don't touch… I think we should also remove them. Without a channel they're useless. Thoughts?

@4www
Copy link
Contributor Author

4www commented Nov 21, 2017

Maybe it is better to do a firebase function that:

  • deletes all tracks
  • removes all relationships from channel.favorites & channel.followers
  • deletes the radio channel

Same for delete account (if no channel || already deleted):

  • delete user settings
  • delete user

@oskarrough
Copy link
Member

Related

#320
#321

@oskarrough oskarrough pinned this issue Feb 4, 2019
@oskarrough oskarrough unpinned this issue Feb 4, 2019
@oskarrough
Copy link
Member

So a couple of findings..

await $E.get('model.favoriteChannels')

Returns a rejected DS.PromiseManyArray with the reason "Record not found".

However, you can still inspect something with

x = $E.get('model.favoriteChannels')
x.content.length // amount of favorites, including the deleted ones
x.content.currentState // array of something like a model

When you iterate through the currentState array, the deleted channels will have an id but no title.

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

No branches or pull requests

2 participants