Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'age' field should be in unsigned #1294

Closed
anoadragon453 opened this issue Jun 12, 2018 · 8 comments
Closed

'age' field should be in unsigned #1294

anoadragon453 opened this issue Jun 12, 2018 · 8 comments

Comments

@anoadragon453
Copy link
Member

The age field of events sent to application services is a constantly changing parameter, and thus should be listed under the unsigned field.

https://matrix.org/docs/spec/application_service/unstable.html#put-transactions-txnid

{
      "age": 32,
      "content": {
        "body": "incoming message",
        "msgtype": "m.text"
      },
      "event_id": "$14328055551tzaee:localhost",
      "origin_server_ts": 1432804485886,
      "room_id": "!TmaZBKYIFrIPVGoUYp:localhost",
      "type": "m.room.message",
      "user_id": "@bob:localhost"
    },

should be:

{
      "content": {
        "body": "incoming message",
        "msgtype": "m.text"
      },
      "event_id": "$14328055551tzaee:localhost",
      "origin_server_ts": 1432804485886,
      "room_id": "!TmaZBKYIFrIPVGoUYp:localhost",
      "type": "m.room.message",
      "unsigned": {
        "age": 32,
      },
      "user_id": "@bob:localhost"
    },
@turt2live
Copy link
Member

for documentation purposes: age currently resides under unsigned for the client/server API.

There seems to be a bunch of issues related to appservices being special in event formats :(

@richvdh
Copy link
Member

richvdh commented Jun 13, 2018

Honestly I'd rather see age going away altogether. Does anything actually rely on it rather than just using origin_server_ts?

There seems to be a bunch of issues related to appservices being special in event formats :(

Yup a bunch of things got fixed for the C-S API around the time /sync got introduced, but the AS API missed the memos.

@Half-Shot
Copy link
Contributor

It's probably fair to deprecate it in the next C-S release, rather than just removing it. For one thing, bridges (like the discord bridge, and I believe the IRC bridge) use it to drop old events that synapse streams to use.

So that's the only use case I can think of in AS land. If someone wants to write a feature for sy/dendrite to NOT send us super old transactions then I won't be needing it.

For Riot it's used for making sure calls don't race and things like that, according to a convo I had with Erik.

@anoadragon453
Copy link
Member Author

fwiw I'm tracking that bug here: matrix-org/dendrite#497 But it probably lies better on this repo.

@anoadragon453
Copy link
Member Author

Also age is apparently used for clients whose clocks might be way off, according to Dave.

turt2live added a commit to turt2live/matrix-doc that referenced this issue Aug 23, 2018
Fixes matrix-org#1269

This is also supposed to fix the 'age' problem, however that is a larger problem with the event schemas that is reserved for a future PR/commit.
Reference: matrix-org#1294
Reference: matrix-org#1524
@Half-Shot
Copy link
Contributor

Is this done, looks like it was done in #1552?

@turt2live
Copy link
Member

#1552 fixes some aspects of the events, although a side effect of #1552 means that the age field still hasn't moved. I've altered #1558 to better describe the age field, and include it in such a way where it would show up in the appservice spec.

@uhoreg
Copy link
Member

uhoreg commented Aug 31, 2018

Fixed by #1558

@uhoreg uhoreg closed this as completed Aug 31, 2018
RiotTranslateBot pushed a commit to RiotTranslateBot/matrix-doc that referenced this issue Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants