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

Change storage.js to support the adding of feeds #706

Closed
c3ho opened this issue Feb 12, 2020 · 4 comments
Closed

Change storage.js to support the adding of feeds #706

c3ho opened this issue Feb 12, 2020 · 4 comments
Assignees
Labels
area: back-end area: redis Redis Database related type: enhancement New feature or request

Comments

@c3ho
Copy link
Contributor

c3ho commented Feb 12, 2020

What would you like to be added:
We need to change code in storage.js to allow new namespaces:

  • t:user: to store feeds for individual users, one user can have multiple feeds for example t:user:[email protected] can contain a feed for OSD700 and one for SPO600

We'll need a new redis key called t:users

We need additional functions to:

  • create the keys with the namespaces
  • add feeds to a user, if we don't have the user yet, create a user then add feed
  • identify feeds already existing in wiki feeds, we'll tag them with admin so an existing feed such as t:feed:ab3b313 will become t:feed:ab3b313:admin since we won't have a user to attach to them.

So in the end we'll have the following sets:

  • users --> contains all the users and their respective feeds
  • feeds --> contains all feeds
  • posts --> contains all posts

storage.js is code we use to interact with Redis, feed.js and post.js will also have to be updated to also use the new code that will be written in storage.js. However we'll only focus on updating storage.js code in here for now.

Why would you like this to be added:
We need additional functionality to support the adding of feeds

@c3ho c3ho added the type: enhancement New feature or request label Feb 12, 2020
@c3ho c3ho changed the title Change storage.js to support the adding of feeds Change storage.js, feed.js and post.js to support the adding of feeds Feb 12, 2020
@c3ho c3ho added area: back-end area: redis Redis Database related labels Feb 12, 2020
@c3ho c3ho changed the title Change storage.js, feed.js and post.js to support the adding of feeds Change storage.js to support the adding of feeds Feb 12, 2020
@c3ho
Copy link
Contributor Author

c3ho commented Feb 13, 2020

For all issues mentioned, feel free to refer to this:
image

@Grommers00
Copy link
Contributor

This next step will probably have to be added in 0.8.

@humphd
Copy link
Contributor

humphd commented Feb 17, 2020

I'm still trying to decide the best way to approach this. My goals are:

  • store as little data as possible about authenticated users.
  • expose as little of what we store via APIs as possible.
  • keep the design simple.

User A authenticates with the SSO provider. We get back a "profile" object that has some data, probably email, username, a user id, etc.

User A wants to add a feed. When we create that feed, we can stamp it with the user's info somehow (maybe add their uid or email or some other piece of public profile data to the Feed object).

A few days later, User A returns and wants to see all her feeds again. This means we need a reverse lookup that shows us all of User A's feeds.

That might be enough. Maybe we should also keep a set of users t:users that has all the unique user ID's we've had add feeds.

TODO:

  1. Make it possible for "user" info to get added to a Feed when we create it. It should also be possible to have this be null, indicating a feed doesn't belong to a particular user (e.g., the wiki feed list we import won't have any user info). The alternative here is to use some default "admin" kind of user info in those Feeds, but null probably does the same thing.
  2. We need to create a set of feeds for a user, t:user:{userid}:feeds, so we can find all the feed ids for this authenticated user.
  3. Maybe add a set for t:users, holding all the "userid" values that own feeds.

@humphd
Copy link
Contributor

humphd commented Apr 1, 2020

I think this can be closed now, as we have coverage for everything in other issues. I want to try and do a bunch of it without modifying the backend significantly.

@humphd humphd closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: back-end area: redis Redis Database related type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants