-
Notifications
You must be signed in to change notification settings - Fork 9
Fix subscribe response deserialize enum #193
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
Conversation
Use default retry configuration for `subscribe` and `presence` REST API calls. fix(deserializer): fix subscribe response deserialize enum Fix the `Presence` enum variant to not intercept user-published messages that partly match the `Presence` variant. refactor(subscribe): refactor modern subscription flow Synchronize subscription flow with other SDKs. refactor(presence): refactor modern presence flow Synchronize presence flow with other SDKs.
Permit `Unicode-3.0` license of one of `reqwest` transient dependencies refactor(clippy): refactor code according to the clippy advices
Add `limit` (default `1000`) and `offset` parameters for `here_now` to fetch presence in portions. fix(subscribe): fix duplicated channels and groups for `subscribe` Fix issue that allowed passing duplicated channels and groups for `subscribe`. fix(heartbeat): fix duplicated channels and groups for `heartbeat` Fix issue that allowed passing duplicated channels and groups for `heartbeat`.
Refactor code that is used for duplicated channels and groups removal to be compatible with `no_std`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| where | ||
| L: Into<Vec<String>>, | ||
| { | ||
| let mut unique = channels.into(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal: When you need to make some pipeline with functions that are not returning self you can use tap dependency:
https://docs.rs/tap/latest/tap/
It's not required - just take a look and decide if you like it or not. ;d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this one is part of the builder, so I need to return self ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it is pretty simple task and to add for it a dependency - not sure in this specific context, but if it will be widely used pattern, then maybe will use it :)
| pub fn state(mut self, state: HashMap<String, Vec<u8>>) -> Self { | ||
| let mut serialized_state = vec![b'{']; | ||
| for (key, mut value) in state { | ||
| serialized_state.append(&mut format!("\"{}\":", key).as_bytes().to_vec()); | ||
| serialized_state.append(&mut value); | ||
| serialized_state.push(b','); | ||
| } | ||
| if serialized_state.last() == Some(&b',') { | ||
| serialized_state.pop(); | ||
| } | ||
| serialized_state.push(b'}'); | ||
|
|
||
| self.state = Some(Some(serialized_state)); | ||
| self | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use serde serialization for serde feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually pretty old one.. I just moved it from other implementation block into this one.
Do you suggest to split it into two in future for serde and not(serde) features?
|
@pubnub-release-bot release |
|
🚀 Release successfully completed 🚀 |
feat(here-now): add
limitandoffsetconfiguration optionsAdd
limit(default1000) andoffsetparameters forhere_nowto fetch presence in portions.feat(retry-configuration): use default retry configuration
Use default retry configuration for
subscribeandpresenceREST API calls.fix: address issue that allowed adding channel and group duplicates in request
Fix the issue because of which it was possible to add the same channel / group multiple times to the
subscribe,heartbeat, orleaverequests.fix(deserializer): fix subscribe response deserialize enum
Fix the
Presenceenum variant to not intercept user-published messages that partly match thePresencevariant.refactor(subscribe): refactor modern subscription flow
Synchronize subscription flow with other SDKs.
refactor(presence): refactor modern presence flow
Synchronize presence flow with other SDKs.