Skip to content

Conversation

@parfeon
Copy link
Contributor

@parfeon parfeon commented Oct 9, 2025

feat(here-now): add limit and offset configuration options

Add limit (default 1000) and offset parameters for here_now to fetch presence in portions.

feat(retry-configuration): use default retry configuration

Use default retry configuration for subscribe and presence REST 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, or leave requests.

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.

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.
@parfeon parfeon self-assigned this Oct 9, 2025
@parfeon parfeon requested a review from Xavrax as a code owner October 9, 2025 21:09
@parfeon parfeon added priority: medium This PR should be reviewed after all high priority PRs. status: done This issue is considered resolved. type: fix This PR contains fixes to existing features. labels Oct 9, 2025
parfeon and others added 8 commits October 10, 2025 00:21
Permit `Unicode-3.0` license of one of `reqwest` transient dependencies

refactor(clippy): refactor code according to the clippy advices
* bump version

* change functions

* so it is supported now ;o?

* more fills

* custom implementation

* out fo the module

* it should work now

* more changes

* more changes related to no std

* serde alloc

* proper names

* ahh, it was important

* fix error
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`.
Copy link
Contributor

@Xavrax Xavrax left a 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();
Copy link
Contributor

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

Copy link
Contributor Author

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 ;)

Copy link
Contributor Author

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 :)

Comment on lines +170 to +184
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
}
Copy link
Contributor

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?

Copy link
Contributor Author

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?

@parfeon
Copy link
Contributor Author

parfeon commented Oct 28, 2025

@pubnub-release-bot release

@parfeon parfeon merged commit b71be3a into master Oct 28, 2025
10 checks passed
@parfeon parfeon deleted the fix/CLEN-2961 branch October 28, 2025 12:14
@pubnub-release-bot
Copy link

🚀 Release successfully completed 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium This PR should be reviewed after all high priority PRs. status: done This issue is considered resolved. type: fix This PR contains fixes to existing features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants