matrix-org / matrix-org/matrix-js-sdk
Make the client only see events from after it was turned on
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 704
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 40
Description
Hi, I'm trying to make a very simple bot that greets users when they enter a room. Source code: https://gitlab.com/alexgleason/solarus-welcome-bot/blob/master/bot.js
Concept:

The problem is, it keeps getting all these events I don't need. Finally, I realized I could do this:
```js
event.event.unsigned.age < 6000
```
to check if an event is from the past 60 seconds. This is good enough, but it doesn't seem to always work. For instance, it always greets t2bot's Discord Bridge user (`@_discord_bot:t2bot.io`) when it starts up, and I don't know why.
My desired behavior is to make the bot start up, mark everything as read, then from that point on respond to room join events.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked bot.js and the event.event.unsigned.age check to understand how room events are received at startup. Trace the SDK entry point that delivers those events and determine how startup state can be marked read; done means the bot ignores existing events but responds to room joins occurring afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100