Skip to content

create_checkpoint uses non-existent .data field instead of .state_data #4176

@elias-ba

Description

@elias-ba

In lib/lightning/collaboration/persistence_writer.ex, the create_checkpoint/1 function references .data on lines 457 and 462:

Yex.apply_update(temp_doc, latest_checkpoint.data)
Yex.apply_update(temp_doc, update_record.data)

However, the DocumentState schema only has state_data:

field :state_data, :binary

This will cause a KeyError crash when a document reaches 500 updates and triggers checkpoint creation. The PersistenceWriter GenServer will crash, potentially losing pending updates.

Metadata

Metadata

Assignees

Labels

bugNewly identified bug

Type

Projects

Status

In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions