Skip to main content
Version: 13 - TBD

RecordCommentWatermark

class flow_api.record_comment_watermark.RecordCommentWatermark(select=None, cls=None, init=None, by='id', allow_normal=True, allow_deleted=False, commit=False, read_until=<class 'flow_api.system.NotSet'>, record_id=<class 'flow_api.system.NotSet'>, debug=False)

Base class: Row

Per-identity read-until watermark for a record's comment thread.

This is the cheap DEFAULT layer of the two-layer comment read model. One row per (record, identity) holds read_until: a comment on the record is read by that identity when its created_at is at or before read_until, and unread when it is newer. "Mark all as read" advances read_until (and the caller drops any per-comment record_comment_read overrides); a comment the viewer authored is treated as read regardless.

Sparse per-comment exceptions to this default live in record_comment_read (its is_read flag). Keeping the default as a single per-(record, identity) watermark makes read-state storage O(records x readers) instead of O(comments x readers).

The watermark's identity_id is always the acting identity — a caller can only set their own read state.

Permission contract:

  • create / update: caller needs READ on the parent record; identity_id is forced to the acting identity (never taken from the request body). The UNIQUE(record_id, identity_id) constraint keeps it one row per (record, identity), so advancing the watermark updates the existing row.
  • read / update / delete: only the owning identity (identity_id == caller), or an internal caller. Read state is inherently per-viewer, so the list select fails closed to the caller's own rows.

This subrecord is deliberately NOT part of the parent record's git exports, so a read-state write never re-serialises the parent's git file nor bumps its modified_at (mirroring record_comment_read).

Parameters

NameTypeDescription
allow_deletedbool
allow_normalbool
bystr
clsOptional
commitbool
debugboolif set, the content of the data being written will be logged.
initOptional
read_untilUnionComments on the record created at or before this point are read by the identity; newer ones are unread (unless a per-comment record_comment_read override says otherwise).
record_idUnionReference to the record whose comment thread this watermark tracks.
selectOptional

Constants

RESOURCE = record_comment_watermark

Methods

clone

delete

duplicate

exists

export

get

get_dict

identity

record

restore

save