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

Space response model #7035

Merged
merged 4 commits into from
Sep 12, 2022
Merged

Space response model #7035

merged 4 commits into from
Sep 12, 2022

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Sep 6, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Ensure that we do not expect Event field that won't be returned by the server by creating a dedicated Json model.

Assigning to Eric who made some change on this area.

Motivation and context

Avoid future mistake of using field that are not provided in the server response.

The current implementation does not use Event.roomId, but with this change, we ensure that it's not the case (and it will not be the case in the future.

See matrix-org/synapse#13506

Screenshots / GIFs

NA

Tests

The code is compiling, there is not behavior nor UI change.

Tested devices

None.

Checklist

`rooms.children_state` is now a list of `SpaceChildSummaryEvent` instead of a list of `Event`.
@Json(name = "content") val content: Content? = null,
@Json(name = "sender") val senderId: String? = null,
@Json(name = "origin_server_ts") val originServerTs: Long? = null,
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only fields declared in this object will be accessible to the SDK and the app.

@sonarcloud
Copy link

sonarcloud bot commented Sep 7, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@ericdecanini ericdecanini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great that we now have a dedicated model for this. LGTM

@bmarty bmarty merged commit ec07704 into develop Sep 12, 2022
@bmarty bmarty deleted the feature/bma/space_response_model branch September 12, 2022 15:24
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.

2 participants