docs: added info on updating the schema

This commit is contained in:
alina 🌸 2024-09-29 00:26:47 +03:00
parent b01a99265b
commit a586327a97
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI

28
packages/tl/UPDATING.md Normal file
View file

@ -0,0 +1,28 @@
## updating checklist
updating a schema and keeping up to date with telegram is a bit of a headache,
so here's a checklist to help me (and maybe you) out:
### common steps
- run `pnpm run fetch-and-gen`
- look at the diff in `diff.json` for `long` types, make sure to update `data/int53-overrides.json` if needed
- run `pnpm run fetch-and-gen` again if there were any changes (note that this will overwrite diff.json file so you may want to have a copy of it)
- run `pnpm run -w lint:tsc` to make sure everything typechecks, if not fix it.
### type-specific steps
#### message-related updates
if there were changes to message-related `Update`-s, make sure to update `_fetchMissingPeers`
in updates manager to accomodate for any new fields.
note that this also aplies to any types used inside them, including but not limited to:
- `messageAction*`
- `messageMedia*`
- `messageReply*Header`, `messageForwardHeader`, etc.
- `messageEntity*`
#### peer-related updates
if there were changes to `user` or `channel`, make sure to update `service/peers.ts` min updating
logic to accomodate for any new fields.