element-hq / element-hq/element-meta

[Tech] Implement poll history cache (MSC4013) in the rust SDK

Open
#2,183 2 comments 0 reactions 0 assignees View on GitHub
App: ElementX Android App: ElementX iOS T-Prep Team: Element X Feature
Dominant language
No language data
Stars
112
Forks
25
Avg merge
6h 6m
Merged PRs (30d)
4

Description

### Description

[MSC4013](https://github.com/matrix-org/matrix-spec-proposals/blob/alfogrillo/poll_history_cache/proposals/4013-poll-history-cache.md) TL;DR;
1. Each room has a new state event `m.room.poll_history`
- Ideally this event is sent when the room is created together with other initial state events (example of initial state event: `m.room.encryption`)
2. Every time a client starts a poll it references the `m.room.poll_history` state event using `m.relates_to`.
3. (out of scope for now) In the poll history we can call the [relations](https://spec.matrix.org/v1.6/client-server-api/#get_matrixclientv1roomsroomidrelationseventid) API to fetch quickly all the events related with `m.room.poll_history` (which are the `m.poll.start` events). Only polls created with this approach will be visible in the history (polls already in the timeline won't be visible).

### Size
M?

### Dependencies
* None

### Acceptance criteria
* Each new created room will has a `m.room.poll_history` state event
* Each new `m.poll.start` (including edits) event has a reference to the new `m.room.poll_history` state event

### Out of scope
* Using the MSC for building the poll history (for now we keep the old "backward pagination" approach)

### Open questions
* [x] How can we publish the new `m.room.poll_history` state event in already existing rooms? Can HS admins publish it in the rooms with a script?
* [ ] Will this change prevent polls hosting threads ([see comment](https://github.com/matrix-org/matrix-spec-proposals/pull/4013#discussion_r1408126980))

### Subtasks

```[tasklist]
### Android
```

```[tasklist]
### iOS
```

```[tasklist]
### Other
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.