Follow users

Heh, true, though :uid in my case can actually be a variety of values, the internal UID from LDAP, a C, a UserName, it all works like that at this moment. The :following_id would be similar as well, can lookup based on any unique value. Sadly the system I have to interact with has user facing ID’s (like the C and the UserName) and back-end unchanging ID’s (the UID), and the CNum and Username can change over time (though always unique), but the UID is constant, however no one knows that the UID even exists as it is never shown anywhere on the front-end of the main system I have to work with. >.>

1 Like

I implemented the follow system exactly as @hubertlepicki suggested. Now I’m struggling how to notify the followers when the followee takes some action (e.g. posts a new article). I tried to insert notifications, one for each follower, into database in a separate process (using Task.start), but my test always shows me that the db connection has been closed by the parent process. How can I make the test process wait for those tasks to finish?

1 Like

I’m sorry. Naming is hard.

1 Like

I wonder if a compound index on user_id with a sub of follower_id would be good?

1 Like

Entirely plausible, depends on the rest of the schema, I make indexes on compound fields all the time. :slight_smile:

1 Like

A late reply but do check out this library. Maybe it can make life easier :slight_smile:

2 Likes