Question about metadata "buckets" and sequence

Since receive-only folders, the metadataTracker has been separated by local flags, which also separates the sequence number. At first I thought that this broke sequences, but after a while I realized it actually is correct. However it only does so, because there is two places that update sequences: FileSet.Update (for local only) and metadataTracker.addFileLocked. The former always updates the sequence of the bucket with flags == 0, the latter considers the flags of the fileinfo. As remote files don’t have local flags, that works. However there is nothing that enforces that remote fileinfos don’t have a local flag set - there’s even a test that does exactly that.

I am wondering if there is a conceptual reason for this. As far as I understand there’s no reason to have more than one sequence counter per device.

Indeed there isn’t. It’s just that the metadataTracker took care of sequence numbers prior to buckets and local flags existing.

Conceptually it would probably be cleaner to track it in a separate thing, today.