Reactions should be added to the bottom of a message group instead of the top #6

Closed
opened 2023-10-11 21:44:31 +00:00 by cadence · 2 comments
Owner

Currently reactions are added to the part=0 message, which is consistent, but this is usually the top of a message group. I will need to also create a similar part= value for the bottom of a message group.

I will probably turn part= into a bitfield where 1 is "is top message, with the most distinguishable content" and 2 is "is bottom message, where reactions should be added to".

Will need a database migration to backfill this.

Suggested backfill:

part=0 -> part=3 because it's the top one and reactions may have already been added here
part=1 -> part=0 because it's neither.

If I change the meaning of part=0, I will also need to go through the code and update code comments that talk about part=0. I could avoid this if I invert the meanings of the 1 bit, but this would be less intuitive for anything I do in the future.

Currently reactions are added to the part=0 message, which is consistent, but this is usually the top of a message group. I will need to also create a similar part= value for the bottom of a message group. I will probably turn part= into a bitfield where 1 is "is top message, with the most distinguishable content" and 2 is "is bottom message, where reactions should be added to". Will need a database migration to backfill this. Suggested backfill: part=0 -> part=3 because it's the top one and reactions may have already been added here part=1 -> part=0 because it's neither. If I change the meaning of part=0, I will also need to go through the code and update code comments that talk about part=0. I could avoid this if I invert the meanings of the 1 bit, but this would be less intuitive for anything I do in the future.
cadence changed title from Reactions should be added to the bottom of a message group to Reactions should be added to the bottom of a message group instead of the top 2023-10-11 21:44:48 +00:00
Author
Owner

SQLite actually supports efficient storage of values 0 and 1, so I may as well add a separate column reaction_part instead of combining them into a single column bitfield.

Using a separate column for reaction_part will also make it easier to understand and query.

SQLite actually supports [efficient storage of values 0 and 1,](https://www.sqlite.org/fileformat2.html#serialtype) so I may as well add a separate column `reaction_part` instead of combining them into a single column bitfield. Using a separate column for `reaction_part` will also make it easier to understand and query.
Author
Owner

A new reaction_part column is now being used as of c247526.

A new `reaction_part` column is now being used as of c247526.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cadence/out-of-your-element#6
No description provided.