Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Empty sync response could be more empty #6579

Closed
bmarty opened this issue Dec 20, 2019 · 5 comments
Closed

Empty sync response could be more empty #6579

bmarty opened this issue Dec 20, 2019 · 5 comments
Labels
T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@bmarty
Copy link

bmarty commented Dec 20, 2019

Currently an empty sync response (i.e. without any change) is like that (with formatting added):

{
  "account_data": {
    "events": []
  },
  "to_device": {
    "events": []
  },
  "device_lists": {
    "changed": [],
    "left": []
  },
  "presence": {
    "events": []
  },
  "rooms": {
    "join": {},
    "invite": {},
    "leave": {}
  },
  "groups": {
    "join": {},
    "invite": {},
    "leave": {}
  },
  "device_one_time_keys_count": {
    "signed_curve25519": 50
  },
  "next_batch": "s1195808412_757269739_794431_REDACTED_1021253_37912961_19608850_66812"
}

According to the spec, only next_batch is required, so it could be acceptable to reduce it to:

{
  "next_batch": "s1195808412_757269739_794431_REDACTED_1021253_37912961_19608850_66812"
}

I do not know if it will solve the global climat changing problem, but if it's easy to fix, let's save some bytes!

@bmarty bmarty added the z-p5 (Deprecated Label) label Dec 20, 2019
@bmarty
Copy link
Author

bmarty commented Jan 13, 2020

I also observe empty elements in the rooms.join part, by instance:

   "rooms": {
     "join": {
       "!gGkYcJLTzcNrfERksd:matrix.org": {
         "timeline": {
           "events": [], HERE
           "prev_batch": "s1222404111_757269739_4298397_414307685_257267759_1042954_39694860_20347120_70307",
           "limited": false
         },
         "state": { HERE
           "events": []
         },
         "account_data": { HERE
           "events": []
         },
         "ephemeral": {
           "events": [
             {
               "type": "m.receipt",
               "content": {
                 "$QIzSpVAHOcFGWWrVc6eXDc0wMBrAj87qtszSyO2TsEU": {
                   "m.read": {
                     "@kindly:naido.org": {
                       "ts": 1578909070063
                     }
                   }
                 }
               }
             }
           ]
         },
         "unread_notifications": {
           "notification_count": 27,
           "highlight_count": 0
         },
         "summary": {} HERE
       }
     }
   }

@deepbluev7
Copy link
Contributor

#9919 fixes the first part, but it doesn't go into rooms.join yet.

@erikjohnston
Copy link
Member

This breaks the current release of Element iOS fwiw, so we should wait for them to fix it and push out a release before doing this. c.f. element-hq/element-ios#4309

@erikjohnston erikjohnston added T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. and removed z-enhancement z-p5 (Deprecated Label) labels May 20, 2021
@richvdh
Copy link
Member

richvdh commented Oct 23, 2021

I think this is done now?

@richvdh richvdh closed this as completed Oct 23, 2021
@deepbluev7
Copy link
Contributor

Was there any PR to strip empty keys from inside room.join for example?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

No branches or pull requests

5 participants