FeedRepository: Embed.Unknown silently dropped during Room serialization #44
Labels
No labels
auth
bug
composer
correctness
database
durability
enhancement
feeds
interactions
notifications
performance
reliability
safety
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starsetbyte/peregrine#44
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
FeedViewPost.toEntity()filtered outEmbed.Unknownvia.takeIf { it !is Embed.Unknown }, so unknown embed types were stored asembedJson = null. On round-trip back to UI, the embed becamenull— indistinguishable from "no embed at all."Fix
Removed the
.takeIffilter. Unknown embeds now serialize as{}(viaTypedUnionSerializerwhentypeOf()returns null) and deserialize back toEmbed.Unknown. The UI still shows nothing for Unknown embeds, but the data is no longer silently discarded.Updated
FeedMappingTestto verify the round-trip behavior.Fixed in PR #36.
Reverted — the
.takeIf { it !is Embed.Unknown }filter is intentional defense. Embed.Unknown exists to prevent unknown lexicon types from crashing a feed page on deserialization, but persisting them as{}adds no value (UI still cannot render them) while creating ambiguity in the DB. Dropping them is correct: on next feed refresh the updated deserializer handles the new type. Closing as wontfix.