-
Notifications
You must be signed in to change notification settings - Fork 2
Breaking Changes
The changelog is essentially the git commit history, so I won't go into full details. But, anytime a change actually impacts the structure or function of the API (and thus will break frontends), I will document the date, version, and the change here.
- Changed userpages to have a true
contentType, which is now 4. Thus, userpages are no longer "pages", they're just more content. - You can now obtain the userpage using a standardized query macro
!userpage(@uid), where you supply the uid in your values (the name of the parameter can be anything ofc). This way, frontends no longer have to ensure they're all using the same userpage query, the API will do it for you. If you're interested, it looks for the first content (by id) withcontentType = 4andcreateUserId = @uidand!notdeleted().
- Fixed leaking information on live events (should be any instance of leaking information, but specifically reported rethreading). HOWEVER, this means you should not assume that there's always something in
objectswhich matches the live events in a live update. If you're creating your frontend to specifically scan the event list, know that some events may have no related content, messages, etc due to modified permissions.
- New websocket event type:
selfbroadcast. You can communicate with other connected clients that are the same user. This breaks anything using api.js: if you are using a local copy of api.js,selfbroadcastwill cause errors in the console, because it doesn't know how to handle that type. It shouldn't break the websocket, but I'm sure the messages are annoying. If you're updating api.js or using the direct link, the parameter list forWebsocketAutoConfighas been altered: the selfBroadcastHandler has been inserted BETWEEN errorEventListener and reconnectIntervalGenerator.
- All types (codes, if you will) have changed from lowerCamelCase to under_score. This should not impact too much, BUT:
- All EVENT types have had _event appended to them. Now, when you receive live data, rather than the middle dictionary being
messagewith a furthermessageinside it, it ismessage_event.message. - The event dictionary name for live data has been changed as well, so it is no longer called
data, it isobjects. - The result dictionary name for
requestresults has changed fromdatatoobjectsas well. - The result dictionary name for
userlistresults has changed fromdatatoobjectsas well.
All together, what this means is that in your websocket, instead of doing this for live data: data.data.message.message you do: data.objects.message_event.message.
Instead of doing data.data.message for requests done inside the websocket, you do data.objects.message
Instead of doing data.data.user for a userlist response from the websocket, you do data.objects.user
- User format changed: added
createUserIdandusersInGroupfields. You can mostly ignore these, unless you're working with groups - User writability changed: can no longer set
groupson user.
Note that the 'groups' field is not going away and most likely never will, but the 'usersInGroup' may be a temporary field just for now. I changed how groups work fundamentally, and so this is kind of a transition period for groups. However, it does NOT impact users, so you do not need to worry about 'usersInGroups', just ignore the field, UNLESS you have an endpoint in your frontend that manages groups.
- All datetime formats in the database have been standardized to https://en.wikipedia.org/wiki/ISO_8601 format. The original format was like
2022-04-07 20:05:09.12345, the new format is2022-04-07T20:05:09.12345Z. - New datetime fields added after this point will only have 3 decimals of precision for seconds (millisecond precision)
- Removed
AutoFixAllDatesandAutoFixDatesfunctions from api.js
- "Votes" changed to "engagement", different structure completely.
- "engagement" added to messages (not yet sent out in live updates though)
- All "vote" endpoints (for writing) changed to "engagement"
So before, you might vote "bad", "ok", or "good" on a page. You'd use the /api/shortcuts/vote endpoints (or something) to set votes on pages. The votes were available in the votes field, and might look something like:
{
"bad" : 3,
"ok" : 5,
"good" : 0
}But now, that field is engagement and it looks like:
{
"vote" : {
"bad" : 3,
"ok" : 5
}
}The difference here is that engagement is an expansion of the voting system, letting you set arbitrary "types" of engagement and aggregating the data for each. Right now there are only "vote" types, but you could add "reaction" or anything else you want, it's arbitrary. This same structure is also available for messages. The new "engagement" endpoints are shown in the Shortcuts section of /api/swagger
- Not necessarily "breaking", but data changes nonetheless: rethreading now stamps EVERY message with an
"originalContentId":1234value, to indicate the original room the message was posted in - Furthermore, when rethreading, the first and last are stamped with additional metadata to describe the rethread. Something like:
"rethread":{"date":"yeah",count:12,lastContentId:123,position:"start|end"}
More on the rethread metadata: the 'lastContentId' will generally be the same as the 'originalContentId' value, but if messages are rethreaded multiple times, the 'originalContentId' value will not change, whereas a new 'rethread' metadata is generated. So, if you only care about the last place the messages were rethreaded from, all data is in 'rethread'. However, if you also want to display where they came from originally, that's what the 'originalContentId' is for
- Thumbnails split from uploads, used to be both went into
uploadsbut now it defaults touploadsandthumbnails