Skip to content

525 Implementation Notes

Adam Fraser edited this page Jan 28, 2015 · 4 revisions

Usages of sequence_id.Before()

We've modified the sequence_id.Before() calculation to use LowSeq instead of Seq when LowSeq is present. Validated that this is the correct usage for the existing usages of Before:

changes.go.193: Checks whether the incoming Since value used for retrieval from the channel caches is earlier than the sequence the user was added to the channel (seqAddedAt). If so, sends all of the channel to the user. If Since has LowSeq set lower than seqAddedAt, it makes sense to send the whole channel (we might not have seen the doc that added them the last time around)

changes.go.209: When deciding whether to create a new entry for the user object changing. If incoming Since is before the user sequence (i.e. when the user was changed). should be good to use LowSeq here if it's below the user sequence.

changes.go.248: Finding the current entry with the minimum sequence. Should just be comparison of sequences in the channel caches, which don't have a LowSeq set (it's only on values sent to/from the client, not in the caches)

Clone this wiki locally