Skip to content

Expose parent post information in the database query for post threads #1032

@joelmuraguri

Description

@joelmuraguri

Is your feature request related to a problem? Please describe.
When loading a post thread from the database, each post result from postThread includes its depth level via generation and which top-level reply branch it belongs to via rootPostUri, but not which specific post it is directly replying to. Without this, spinThread cannot reconstruct who replied to whom at the app level, which blocks building a proper reply tree.

Describe the solution you'd like
Add parentPostUri to ThreadedPostEntity and update the postThread DAO query to select it in the final result. The parentPostUricolumn is already available via the postThreads table which is joined inside the existing CTEs, it just is not included in the final SELECT. The anchor post (generation 0) should return null for this field.

Describe alternatives you've considered
Inferring parent relationships from generation numbers alone inside spinThread not workable because sibling replies share the same generation value and cannot be distinguished without an explicit parent URI.

Additional context
This is a purely additive change with no impact on existing behaviour. spinThread does not yet read parentPostUri so nothing breaks.

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions