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

Tracking for Release v0.18.0 #576

Merged
merged 20 commits into from
Nov 24, 2024
Merged

Tracking for Release v0.18.0 #576

merged 20 commits into from
Nov 24, 2024

Conversation

kozabrada123
Copy link
Member

@kozabrada123 kozabrada123 commented Nov 1, 2024

Release tracker for v0.18.0 of chorus, set to release on November 24th, 2024.

Public API changes

  • Various entity improvements #570: Various entity public api changes
  • 644d3be, 85e922b: Add type OneOrMoreSnowflakes, allow GatewayRequestGuildMembers to request multiple guild and user ids
  • f65b9c1: Differentiate PresenceUpdate and GatewayPresenceUpdate
  • 0e5fd86: Temporarily fix PresenceUpdate for Spacebar Client by making user optional
  • 61ac7d1: Updated LazyRequest (op 14) to use the Snowflake type for ids instead of just String

Additions

Bugfixes

  • Implement custom sqlx::Postgres en-/decoding for PremiumType enum #565: Fix sqlx En-/Decoding of PremiumType
  • 7460d3f: Fix GatewayIdentifyConnectionProps for Spacebar Client by deriving default on all fields, since the client does not send it
  • 3d9460f: Derive Default for MessageReferenceType, assume default reference_type if none is provided
  • 4baecf9: Fixed a deserialization error related to presences in GuildMembersChunk being an array, not a single value
  • 1b20102: Fixed a deserialization error with deserializing activities in PresenceUpdate as an empty array when they are sent as null
  • 7feb571: Fixed a deserialization error on discord.com related to experiments (they are not implemented yet, see Implement Experiments #578)
  • fb94afa: Fixed a deserialization error on discord.com related to last_viewed in ReadState being a version / counter, not a DateTime

Internal changes

bitfl0wer and others added 18 commits October 11, 2024 23:42
* Add new types for some fields in Channels struct (read commit desc)
- Conditionally compile applied_tags for sqlx feature
- Add DefaultForumLayout enum
- Add DefaultSearchOrder enum

* Add todo on ChannelCreateSchema

* Change DefaultSearchOrder to DefaultSortOrder

* remove unneeded import

* rename columns for sql(x)

* add note about backend feature

* rename struct fields of UserNote to be more sensible
…e if none is provided

Thanks @greysilly7 for discovering this!
* feat: add Request/Response and other necessary objects for MFA implementation

* refactor: remove old Response object involved in MFA implementation

* feat: add MFARequired error to ChorusError

* refactor: wrap object field type with `Option` and change `shell()` method accordingly

This change allows to exactly know when a ChorusUser is authenticated or not

* feat: add `complete_mfa_challenge` method to ChorusUser

* refactor: remove mfa_token argument from `ChorusRequest` `new` method

* feat: add handling for MFA Required response errors

* refactor: change `User` object assignements according to changes done in `ChorusUser`

* refactor: change `ChorusUser` new method calls according to changes done

* fix: typo in `ChorusError::MfaRequired` `Display` message

* fix: concatenate `Instance`'s api url with endpoint

* fix: according to changes made to `ChorusUser` object field 4920c91

* feat: add Request/Response objects for MFA verification endpoints

* feat: add SuspendedUser error value on ChorusError

* feat: add endpoints for Verify MFA Login and Send MFA SMS

* feat: add skeleton structure for MFA endpoints tests

* refactor: comments

* remove Option from ChorusUser object, mildly refactor logins

Remove option from the ChorusUser object field, since it makes the api a lot worse.

Tihs means we still call ChorusUser::shell a few times (mostly in logins, but also in one mfa route).

The ratelimiter should be refactored at some point to allow an instance send unauthenticated ratelimited requests

* clean up tests which still used object option

* Add a fixme

* feat: add api to add mfa to a request

* fix: feature lock entities/mfa_token

Locks entities/mfa_token.rs to the client feature.

This representation is purely client sided, for a server sided
mfa token, you'd likely only store the expiration timestamp and
give the JWT to be handled by the client.

* fix: forgot to set token

* chore: mock mfa tests with httptest crate, add framework for mocked tests

* chore: ah

* fix: httptest does not work on wasm

* fix: heh?

* fix: improper serialization of authenticator type

* fix: httptest panics

* feat: send mfa token where needed, add some mfa routes

- add Enable and Disable TOTP MFA routes
- add Enable and Disable SMS MFA routes

* feat: add mfa authenticator type, get webauthn authenticators

- Adds the MfaAuthenticator type
- Renames AuthenticatorType to MfaAuthenticationType - these are ways we can authenticate, not types of authenticators
- Adds MfaAuthenticatorType, removes the old ReadyAuthenticatorType which was just this type in the Ready payload
- Adds the get_webauthn_authenticators route

* feat: add last of mfa routes, mfa events

* docs: fix broken doc link

* chore: test a lot of user mfa routes

* the fake ticket is too real

* fix: missing slash in endpoint url

* chore: add tests for backup codes routes

* chore: remove unused import

* api: improve MFA api

changes:
- Removed the weirdness with EnableTotpMfaReturn and EnableTotpMfaResponse. I've realized we have not reason to hide a received token from library users, as they'll probably want to save it somewhere as well.
- For the same reason, made disable_totp_mfa return the new token
- Updated documentation on several mfa types
- Renamed type MfaVerificationSchema to MfaChallenge
- Renamed field mfa on MfaRequiredSchema to mfa_challenge

* api: easier mfa api

- Added two aliases for ChorusUser::complete_mfa_challenge, MfaChallenge::complete and MfaVerifySchema::verify_mfa

* fix: compile on non-default-features

---------

Co-authored-by: xystrive <[email protected]>
Co-authored-by: bitfl0wer <[email protected]>
* Add CloseCode and VoiceCloseCode

* From Message for VoiceCloseCode,CloseCode, as_tungstenite_close_frame for VoiceCloseCode,CloseCode

* Add conditional compilation flags

* Add conditional compilation flags

* Update src/types/utils/opcode.rs

Co-authored-by: kozabrada123 <[email protected]>

* Update src/types/utils/opcode.rs

Co-authored-by: kozabrada123 <[email protected]>

---------

Co-authored-by: kozabrada123 <[email protected]>
* fix: refactor gateway to properly handle close frames

* chore: add gateway test for receiving close frames

* fix: refactor voice gateway as well
## Description:

- Discord is messing with their api again, read states are a mystery
- Refactored the gateway to fully use the `Opcode` enum instead of constants (4ed68ce)
- Added Last Messages request and response (4ed68ce)
- Fixed a deserialization error related to `presences` in `GuildMembersChunk` being an array, not a single value (4baecf9)
- Fixed a deserialization error with deserializing `activities` in `PresenceUpdate` as an empty array when they are sent as `null` (1b20102)
- Add type `OneOrMoreSnowflakes`, allow `GatewayRequestGuildMembers` to request multiple guild and user ids (644d3be, 85e922b)
- Updated `LazyRequest` (op 14) to use the `Snowflake` type for ids instead of just `String` (61ac7d1)
- Fixed a deserialization error on discord.com related to experiments (they are not implemented yet, see #578) (7feb571)
- Fixed a deserialization error on discord.com related to `last_viewed` in `ReadState` being a version / counter, not a `DateTime` (fb94afa)

## Commits:

* fix: temporarily fix READY on Spacebar

Spacebar servers have mention_count in ReadStateEntry as nullable, as well as not having the flags field

This should probably be investigated further

Reported by greysilly7 on the polyphony discord

* fix: on DDC the user field in Relationship is not send in READY anymore

* fix: for some reason presences wasn't an array??

* fix: deserialize activities: null as empty array

* feat: add OneOrMoreSnowflakes type

Adds a public type which allows serializing one snowflake or an array of snowflakes.

Useful for e.g. request guild members, where we can request either for one user or for multiple

* feat: update RequestGuildMembers, allow multiple snowflakes

Updates the RequsetGuildMembers gateway event, allows to query multiple user_ids and guild_ids using OneOrMoreSnowflakes type, update its documentation

* fix?: add Default to OneOrMoreSnowflakes, GatewayRequestGuildMembers

* feat: add gateway last messages, refactor gateway to use Opcode enum

* fix: the string in lazy request is a snowflake

* fix: deserialization error related to experiments on Discord.com

See also #578 on why we aren't currently juts implementing them as types

* fix?: last_viewed is a counter, not a datetime

thanks to MaddyUnderStars; this explanation seems to make sense considering we only need to know if we are ahead / behind the version, not when exactly it was accessed
@kozabrada123
Copy link
Member Author

And... CI is officially borked

@kozabrada123 kozabrada123 added the Release A pull request from dev to main, creating a new release label Nov 21, 2024
@kozabrada123 kozabrada123 marked this pull request as ready for review November 24, 2024 06:38
@kozabrada123 kozabrada123 merged commit d9d6ea9 into main Nov 24, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release A pull request from dev to main, creating a new release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants