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

✨ Deliver UserResource in StatusResource #2565

Merged

Conversation

jheubuch
Copy link
Contributor

@jheubuch jheubuch commented May 18, 2024

This PR implements, that within the StatusResource the whole UserResource will be transmitted and not just bits of it.

Open questions:

  • When should the other fields be scheduled for deprecation?
  • At the moment I named the property userDetails since user was already taken by the ID. Maybe you have a better name? (In future after deleting the conflicting fields, it could be renamed to user again)

@jheubuch
Copy link
Contributor Author

Could also be interesting for you, @marhei and @bendix-dev

@MrKrisKrisu
Copy link
Member

Generell bin ich dabei - ich würde dann, wenn der Key user frei wird die userDetails nochmal umbenennen (sorry, API-Consumer.)

Die Änderung könnte so aber die API Responses stark verlangsamen. Wir sollten an der Stelle Resourcen nutzen, die weniger viele Daten ausgeben. Bei jedem Status z.B. die totale trainDistance und trainDuration auszugeben ist bisschen much.

@jheubuch
Copy link
Contributor Author

Generell bin ich dabei - ich würde dann, wenn der Key user frei wird die userDetails nochmal umbenennen (sorry, API-Consumer.)

Find ich gut :)

Die Änderung könnte so aber die API Responses stark verlangsamen. Wir sollten an der Stelle Resourcen nutzen, die weniger viele Daten ausgeben. Bei jedem Status z.B. die totale trainDistance und trainDuration auszugeben ist bisschen much.

Also quasi eine "schlanke" UserResource, die das wichtigste Zeug ohne Berechnungen beinhaltet?

@MrKrisKrisu
Copy link
Member

MrKrisKrisu commented May 19, 2024

Also quasi eine "schlanke" UserResource, die das wichtigste Zeug ohne Berechnungen beinhaltet?

Exakt! I mean, was braucht man an der Stelle?
ID, username, displayname, profilePicture, ... würde (mir) wahrscheinlich schon reichen.

Einwände? (cc @marhei, @bendix-dev, @vainamov, @HerrLevin)

@vainamov
Copy link
Member

Passt von meiner Seite her! Die Umbenennung zurück in user ist auf jeden Fall sinnvoll und die vorgeschlagenen Felder sind für uns auch ausreichend 👍

@jheubuch
Copy link
Contributor Author

I mean, was braucht man an der Stelle?
ID, username, displayname, profilePicture, ... würde (mir) wahrscheinlich schon reichen.

Ich hätte gerne noch die URL zum Mastodon-Account (das war die Intention hinter dem PR), aber sonst wäre ich auch glücklich :)

@bendix-dev
Copy link

Passt für mich, ich brauche fürs Erste nur die Felder, die auch vorher schon da waren.

@MrKrisKrisu MrKrisKrisu marked this pull request as draft May 20, 2024 17:15
@jheubuch jheubuch marked this pull request as ready for review May 22, 2024 12:23
jheubuch and others added 5 commits May 22, 2024 14:30
@MrKrisKrisu
Copy link
Member

MrKrisKrisu commented May 31, 2024

Deprecation notice

Note

Backwards compatibility guaranteed until August 2024.

The StatusResource is now returning the whole UserResource for the user who created it in the userDetails field.
Thus the following fields of the StatusResource are now marked as deprecated and will be removed after August 2024.

  • user
  • username
  • profilePicture
  • preventIndex

This data is also available in the userDetails field.

{
  "data": {
    ...
    "user": 1, //deprecated - removed after 2024-08
    "username": "Gertrud123", //deprecated - removed after 2024-08
    "profilePicture": "https://traewelling.de/@Gertrud123/picture", //deprecated - removed after 2024-08
    "preventIndex": false, //deprecated - removed after 2024-08
    ...
    "userDetails": { //new - but deprecated. See below.
      "id": 1,
      "displayName": "Gertrud",
      "username": "Gertrud123",
      "profilePicture": "https://traewelling.de/@Gertrud123/picture",
      "mastodonUrl": "https://traewelling.social/@Gertrud123",
      "preventIndex": false
    }
  }
}

Looking ahead

The new key userDetails is already deprecated. We will rename this key to user in August 2024 after the current user attribute is removed. This will also be backwards compatible and will be announced accordingly.


(@Traewelling/api-consumer - to subscribe to breaking api changes see #2619)

@MrKrisKrisu MrKrisKrisu merged commit 95f6431 into Traewelling:develop May 31, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants