Skip to content

Commit b71be3a

Browse files
parfeonXavrax
andauthored
Fix subscribe response deserialize enum (#193)
feat(retry-configuration): use default retry configuration 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. feat(here-now): add `limit` and `offset` configuration options 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`. --------- Co-authored-by: Mateusz Dahlke <39696234+Xavrax@users.noreply.github.com>
1 parent ad11aeb commit b71be3a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+866
-2989
lines changed

.github/workflows/commands-handler.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ jobs:
2424
run: echo -e "\033[38;2;19;181;255mThis is regular commit which should be ignored.\033[0m"
2525
- name: Checkout repository
2626
if: steps.user-check.outputs.expected-user == 'true'
27-
uses: actions/checkout@v3
27+
uses: actions/checkout@v5
2828
with:
2929
token: ${{ secrets.GH_TOKEN }}
3030
- name: Checkout release actions
3131
if: steps.user-check.outputs.expected-user == 'true'
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@v5
3333
with:
3434
repository: pubnub/client-engineering-deployment-tools
3535
ref: v1

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
release: ${{ steps.check.outputs.ready }}
1616
steps:
1717
- name: Checkout actions
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v5
1919
with:
2020
repository: pubnub/client-engineering-deployment-tools
2121
ref: v1
@@ -34,13 +34,13 @@ jobs:
3434
if: needs.check-release.outputs.release == 'true'
3535
steps:
3636
- name: Checkout repository
37-
uses: actions/checkout@v3
37+
uses: actions/checkout@v5
3838
with:
3939
# This should be the same as the one specified for on.pull_request.branches
4040
ref: master
4141
token: ${{ secrets.GH_TOKEN }}
4242
- name: Checkout actions
43-
uses: actions/checkout@v3
43+
uses: actions/checkout@v5
4444
with:
4545
repository: pubnub/client-engineering-deployment-tools
4646
ref: v1

.github/workflows/run-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
group: organization/Default
2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v5
2727
- name: Run unit tests
2828
run: |
2929
cargo test --features="full"
@@ -39,9 +39,9 @@ jobs:
3939
group: organization/Default
4040
steps:
4141
- name: Checkout project
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v5
4343
- name: Checkout mock-server action
44-
uses: actions/checkout@v3
44+
uses: actions/checkout@v5
4545
with:
4646
repository: pubnub/client-engineering-deployment-tools
4747
ref: v1
@@ -58,7 +58,7 @@ jobs:
5858
run: |
5959
cargo test --features contract_test --test contract_test
6060
- name: Expose acceptance tests reports
61-
uses: actions/upload-artifact@v3
61+
uses: actions/upload-artifact@v4
6262
with:
6363
name: acceptance-test-reports
6464
path: tests/reports/*.xml

.github/workflows/run-validations.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
runs-on:
4545
group: organization/Default
4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v5
4848

4949
- name: Run cargo check tool to check if the code are valid
5050
run: |
@@ -80,8 +80,8 @@ jobs:
8080
# Prevent sudden announcement of a new advisory from failing ci:
8181
continue-on-error: ${{ matrix.checks == 'advisories' }}
8282
steps:
83-
- uses: actions/checkout@v3
84-
- uses: EmbarkStudios/cargo-deny-action@v1
83+
- uses: actions/checkout@v5
84+
- uses: EmbarkStudios/cargo-deny-action@v2
8585
with:
8686
command: check ${{ matrix.checks }}
8787

@@ -90,7 +90,7 @@ jobs:
9090
runs-on:
9191
group: organization/Default
9292
steps:
93-
- uses: actions/checkout@v3
93+
- uses: actions/checkout@v5
9494

9595
- name: Install WASM target
9696
uses: actions-rs/toolchain@v1
@@ -109,7 +109,7 @@ jobs:
109109
runs-on:
110110
group: organization/Default
111111
steps:
112-
- uses: actions/checkout@v3
112+
- uses: actions/checkout@v5
113113

114114
- name: Install `no_std` target
115115
uses: actions-rs/toolchain@v1
@@ -119,12 +119,16 @@ jobs:
119119

120120
- name: Run cargo check tool to check if the `no_std` code are valid
121121
uses: actions-rs/cargo@v1
122+
env:
123+
RUSTFLAGS: '--cfg getrandom_backend="unsupported"'
122124
with:
123125
command: check
124-
args: --lib --no-default-features --features=full_no_std_platform_independent,mock_getrandom
126+
args: --lib --no-default-features --features=full_no_std_platform_independent
125127

126128
- name: Run cargo check tool to check if the additional example code are valid
127129
uses: actions-rs/cargo@v1
130+
env:
131+
RUSTFLAGS: '--cfg getrandom_backend="custom"'
128132
with:
129133
command: check
130134
args: --manifest-path examples/no_std/Cargo.toml --target thumbv7m-none-eabi

.pubnub.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
name: rust
2-
version: 0.6.0
2+
version: 0.7.0
33
schema: 1
44
scm: github.com/pubnub/rust
55
files: []
66
changelog:
7+
- date: 2025-10-28
8+
version: 0.7.0
9+
changes:
10+
- type: feature
11+
text: "Add `limit` (default `1000`) and `offset` parameters for `here_now` to fetch presence in portions."
12+
- type: feature
13+
text: "Use default retry configuration for `subscribe` and `presence` REST API calls."
14+
- type: bug
15+
text: "Fix the issue because of which it was possible to add the same channel / group multiple times to the `subscribe`, `heartbeat`, or `leave` requests."
16+
- type: bug
17+
text: "Fix the `Presence` enum variant to not intercept user-published messages that partly match the `Presence` variant."
18+
- type: improvement
19+
text: "Synchronize subscription flow with other SDKs."
20+
- type: improvement
21+
text: "Synchronize presence flow with other SDKs."
722
- date: 2024-02-07
823
version: 0.6.0
924
changes:

Cargo.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pubnub"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
edition = "2021"
55
license-file = "LICENSE"
66
authors = ["PubNub <support@pubnub.com>"]
@@ -67,7 +67,6 @@ contract_test = ["parse_token", "publish", "access", "crypto", "std", "subscribe
6767
full_no_std = ["serde", "reqwest", "crypto", "parse_token", "blocking", "publish", "access", "subscribe", "tokio", "presence"]
6868
full_no_std_platform_independent = ["serde", "crypto", "parse_token", "blocking", "publish", "access", "subscribe", "presence"]
6969
pubnub_only = ["crypto", "parse_token", "blocking", "publish", "access", "subscribe", "presence"]
70-
mock_getrandom = ["getrandom/custom"]
7170
# TODO: temporary treated as internal until we officially release it
7271
subscribe = ["dep:futures"]
7372
presence = ["dep:futures"]
@@ -80,28 +79,28 @@ spin = "0.9"
8079
phantom-type = { version = "0.4.2", default-features = false }
8180
percent-encoding = { version = "2.1", default-features = false }
8281
base64 = { version = "0.21", features = ["alloc"], default-features = false }
83-
derive_builder = { version = "0.12", default-features = false }
82+
derive_builder = { version = "0.12.0", default-features = false }
8483
uuid = { version = "1.3", features = ["v4"], default-features = false }
8584
snafu = { version = "0.7", features = ["rust_1_46"], default-features = false }
8685
rand = { version = "0.8.5", default-features = false }
8786

8887
# signature
8988
hmac = "0.12"
90-
sha2 = {version = "0.10", default-features = false }
89+
sha2 = { version = "0.10", default-features = false }
9190
time = { version = "0.3", features = ["alloc"], default-features = false }
9291

9392
# serde
94-
serde = { version = "1.0", features = ["derive"], optional = true, default-features = false }
95-
serde_json = { version = "1.0", optional = true, features = ["alloc"] ,default-features = false }
93+
serde = { version = "1.0", features = ["derive", "alloc"], optional = true, default-features = false }
94+
serde_json = { version = "1.0", optional = true, features = ["alloc"], default-features = false }
9695

9796
# reqwest
98-
reqwest = { version = "0.11", optional = true }
97+
reqwest = { version = "0.12", optional = true }
9998
bytes = { version = "1.4", default-features = false, optional = true }
10099

101100
# crypto
102101
aes = { version = "0.8.2", optional = true }
103102
cbc = { version = "0.1.2", optional = true }
104-
getrandom = { version = "0.2", optional = true }
103+
getrandom = { version = "0.3", optional = true }
105104

106105
# parse_token
107106
ciborium = { version = "0.2.1", default-features = false, optional = true }
@@ -115,18 +114,18 @@ async-channel = { version = "1.8", optional = true }
115114
portable-atomic = { version = "1.3", optional = true, default-features = false, features = ["require-cas", "critical-section"] }
116115

117116
[target.'cfg(target_arch = "wasm32")'.dependencies]
118-
getrandom = { version = "0.2", features = ["js"] }
117+
getrandom = { version = "0.3", features = ["wasm_js"] }
119118

120119
[dev-dependencies]
121120
async-trait = "0.1"
122121
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
123122
wiremock = "0.5"
124123
env_logger = "0.10"
125124
cucumber = { version = "0.20.2", features = ["output-junit"] }
126-
reqwest = { version = "0.11", features = ["json"] }
125+
reqwest = { version = "0.12", features = ["json"] }
127126
test-case = "3.0"
128127
hashbrown = { version = "0.14.0", features = ["serde"] }
129-
getrandom = { version = "0.2", features = ["custom"] }
128+
getrandom = { version = "0.3" }
130129

131130
[build-dependencies]
132131
built = "0.6"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ Add `pubnub` to your Rust project in the `Cargo.toml` file:
3636
```toml
3737
# default features
3838
[dependencies]
39-
pubnub = "0.6.0"
39+
pubnub = "0.7.0"
4040

4141
# all features
4242
[dependencies]
43-
pubnub = { version = "0.6.0", features = ["full"] }
43+
pubnub = { version = "0.7.0", features = ["full"] }
4444
```
4545

4646
### Example
@@ -164,11 +164,11 @@ disable them in the `Cargo.toml` file, like so:
164164
```toml
165165
# only blocking and access + default features
166166
[dependencies]
167-
pubnub = { version = "0.6.0", features = ["blocking", "access"] }
167+
pubnub = { version = "0.7.0", features = ["blocking", "access"] }
168168

169169
# only parse_token + default features
170170
[dependencies]
171-
pubnub = { version = "0.6.0", features = ["parse_token"] }
171+
pubnub = { version = "0.7.0", features = ["parse_token"] }
172172
```
173173

174174
### Available features
@@ -207,7 +207,7 @@ you need, for example:
207207

208208
```toml
209209
[dependencies]
210-
pubnub = { version = "0.6.0", default-features = false, features = ["serde", "publish",
210+
pubnub = { version = "0.7.0", default-features = false, features = ["serde", "publish",
211211
"blocking"] }
212212
```
213213

deny.toml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
# Root options
1+
[graph]
22
targets = [
33
#{ triple = "x86_64-unknown-linux-musl" },
44
]
55
all-features = false
66
no-default-features = false
7+
8+
[output]
79
feature-depth = 1
810

911
# This section is considered when running `cargo deny check advisories`
1012
# More documentation for the advisories section can be found here:
1113
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
1214
[advisories]
15+
version = 2
1316
db-path = "~/.cargo/advisory-db"
1417
db-urls = ["https://github.com/rustsec/advisory-db"]
15-
vulnerability = "deny"
16-
unmaintained = "warn"
18+
unmaintained = "workspace"
1719
yanked = "warn"
18-
notice = "warn"
1920
ignore = [
2021
#"RUSTSEC-0000-0000",
2122
]
@@ -24,7 +25,7 @@ ignore = [
2425
# More documentation for the licenses section can be found here:
2526
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
2627
[licenses]
27-
unlicensed = "deny"
28+
version = 2
2829
allow = [
2930
# Before inserting a new license here, please check if it is already in the list of
3031
# licenses that are allowed: https://blueoakcouncil.org/list
@@ -33,15 +34,10 @@ allow = [
3334
"Apache-2.0",
3435
"BlueOak-1.0.0",
3536
"Unicode-DFS-2016",
37+
"Unicode-3.0",
3638
"BSD-3-Clause",
3739
#"Apache-2.0 WITH LLVM-exception",
3840
]
39-
deny = [
40-
#"Nokia",
41-
]
42-
copyleft = "warn"
43-
allow-osi-fsf-free = "neither"
44-
default = "deny"
4541
confidence-threshold = 0.8
4642
exceptions = [
4743
{ allow = ["LicenseRef-PubNub-Software-Development-Kit-License"], name = "pubnub" },
@@ -52,7 +48,7 @@ exceptions = [
5248
[[licenses.clarify]]
5349
name = "pubnub"
5450
expression = "LicenseRef-PubNub-Software-Development-Kit-License"
55-
license-files = [ { path = "LICENSE", hash = 0x48826f13 }, ]
51+
license-files = [{ path = "LICENSE", hash = 0x48826f13 }, ]
5652

5753

5854
[licenses.private]

examples/no_std/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9-
pubnub = { path = "../../", default_features = false, features = ["blocking", "serde", "publish", "subscribe", "presence"] }
10-
serde = { version = "1.0", default_features = false, features = ["derive"] }
11-
getrandom = { version = "0.2", default_features = false, features = ["custom"] }
9+
pubnub = { path = "../../", default-features = false, features = ["blocking", "serde", "publish", "subscribe", "presence"] }
10+
serde = { version = "1.0", default-features = false, features = ["derive"] }
11+
getrandom = { version = "0.3", default_features = false }
1212

1313
[[bin]]
1414
name = "publish"

0 commit comments

Comments
 (0)