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

Request response browser streaming #579

Merged
merged 79 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
4d5e5c7
Checkpoint
Apr 16, 2024
6e2dd64
First draft of public API and stubbed napi creation/shutdown
Apr 17, 2024
5c2bf31
Checkpoint
Apr 18, 2024
8c94ad7
Checkpoint
bretambrose Apr 18, 2024
3690d24
Checkpoint
Apr 20, 2024
083ee94
Fix compile errors
Apr 20, 2024
d25834b
Commenting
Apr 20, 2024
8e92a66
Checkpoint
bretambrose Apr 22, 2024
e031e7e
Test refactoring
bretambrose Apr 22, 2024
158e972
Check in test work so that dependencies can be mucked with
Apr 24, 2024
acfde2d
Update io to fix threading issue
bretambrose May 1, 2024
8222b70
Checkpoint
bretambrose May 1, 2024
523f62c
First invalid request failure test
bretambrose May 2, 2024
dd746cd
More request submit failure tests
bretambrose May 2, 2024
0216688
request response tests complete
May 2, 2024
ecd3b26
Update io
May 2, 2024
49476eb
Bump size check
May 2, 2024
cdc1388
Compiles checkpoint
May 3, 2024
3f7a476
PR feedback
May 3, 2024
19e08f6
Merge branch 'RequestResponseLifecycle' into RequestResponseStreams
May 3, 2024
4c05fda
Incoming publish callback impl
May 3, 2024
3d31cd4
Subscription status callback initial impl
May 4, 2024
696bc1b
Build errors
May 4, 2024
0096724
Fixes
bretambrose May 6, 2024
00f9004
Checkpoint
bretambrose May 6, 2024
c509cd8
Streaming operation tests
May 7, 2024
593185d
also wait for subscription to complete
May 7, 2024
734b019
Fixups
May 7, 2024
4f708e1
Streaming operation auto-close on client close
May 7, 2024
8b9b2c6
Polish
May 8, 2024
2bb9f29
Request response payload to binary not string
bretambrose May 10, 2024
1a78c82
Formatting
bretambrose May 10, 2024
2c20889
Fix streaming operation lifetime management
bretambrose May 13, 2024
283b87d
Merge branch 'main' into RequestResponseStreams
Jul 11, 2024
c2ab981
Checkpoint
Jul 12, 2024
e1041bd
Adapter tests and bug fixes
Jul 17, 2024
a6875f6
Temporarily remove some placeholder files
Jul 17, 2024
7d9d1c5
Interface checkpoint
Jul 17, 2024
22dfd5d
PR feedback
bretambrose Jul 18, 2024
a7b1f84
Merge branch 'RequestResponseBrowser1' into RequestResponseBrowser2
bretambrose Jul 18, 2024
d2d130b
Checkpoint
bretambrose Jul 18, 2024
ccdb6dc
Set closed and test
bretambrose Jul 18, 2024
b35d0cd
Merge branch 'RequestResponseBrowser1' into RequestResponseBrowser2
bretambrose Jul 18, 2024
0b479c1
Subscription manager port
bretambrose Jul 19, 2024
19bcd02
Simple logging API; defaults to console
Jul 22, 2024
0d311d6
Merge branch 'SimpleLogging' into RequestResponseBrowser2
Jul 22, 2024
1874d8e
Tweaks
Jul 22, 2024
4c063cc
Spelling
Jul 22, 2024
7200c6b
Merge branch 'SimpleLogging' into RequestResponseBrowser2
Jul 22, 2024
01bdae5
Cautionary comments
Jul 22, 2024
bbaceea
Merge branch 'SimpleLogging' into RequestResponseBrowser2
Jul 22, 2024
ce453da
Simplify API
Jul 22, 2024
6016a59
Merge branch 'SimpleLogging' into RequestResponseBrowser2
Jul 22, 2024
2800adb
Subscription Manager logging
Jul 22, 2024
4ed32c6
Checkpoint
Jul 24, 2024
e617c72
Checkpoint
bretambrose Jul 24, 2024
927420f
Checkpoint
Jul 26, 2024
880fd88
Checkpoint
bretambrose Jul 26, 2024
fbdc8ac
Test complete
bretambrose Jul 26, 2024
dd9c928
Move mock and support functions to separate file for future sharing
Jul 29, 2024
66650ca
Merge branch 'main' into RequestResponseBrowser2
bretambrose Aug 23, 2024
9e23992
Merge from main
bretambrose Aug 23, 2024
08ac514
Bump size
bretambrose Aug 23, 2024
0cd4daa
Use session token on session credentials
bretambrose Aug 26, 2024
e14deae
PR updates
bretambrose Aug 26, 2024
50cac1e
Indirect support for mqtt request response
bretambrose Aug 26, 2024
5492c74
Request response browser implementation and tests; large testing refa…
bretambrose Aug 26, 2024
d5663e1
Streaming operation support
bretambrose Aug 27, 2024
fbaa248
First batch of tests and fixes
bretambrose Sep 4, 2024
c7a2ce2
Checkpoint
Sep 6, 2024
3b72495
Test fixups/polish
bretambrose Sep 9, 2024
23efd3e
Non-branch submodule update
Sep 12, 2024
34ee417
Update submodules
Nov 18, 2024
6d0b84a
Merge branch 'main' into RequestResponseBrowserStreaming
Nov 18, 2024
83d23f9
Bump size limit
Nov 18, 2024
0e7bb15
Node-only logging statement that might help uncover test failure
Nov 18, 2024
596c3a8
Use relative path
Nov 18, 2024
6cd23c5
Revert
Nov 18, 2024
89bbeff
Merge branch 'main' into RequestResponseBrowserStreaming
bretambrose Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .builder/actions/crt_size_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def run(self, env):
# Maximum package size (for current platform) in bytes
# NOTE: if you increase this, you might also need to increase the
# limit in continuous-delivery/pack.sh
max_size = 8_000_000
max_size = 8_250_000
# size of current folder
folder_size = 0
# total size in bytes
Expand Down
2 changes: 2 additions & 0 deletions lib/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import * as http from './browser/http';
import * as crypto from './browser/crypto';
import * as iot from './browser/iot';
import * as auth from './browser/auth';
import * as mqtt_request_response from './browser/mqtt_request_response';
import { ICrtError, CrtError } from './browser/error';

export {
Expand All @@ -31,6 +32,7 @@ export {
io,
iot,
mqtt,
mqtt_request_response,
mqtt5,
platform,
promise,
Expand Down
10 changes: 8 additions & 2 deletions lib/browser/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@
* @mergeTarget
*/

export { TlsVersion, SocketType, SocketDomain } from "../common/io";
import { SocketType, SocketDomain } from "../common/io";
import { setLogLevel, LogLevel, SocketType, SocketDomain } from "../common/io";
// Do not re-export the logging functions in common; they are package-private
export { setLogLevel, LogLevel, TlsVersion, SocketType, SocketDomain } from "../common/io";


/**
* @return false, as ALPN is not configurable from the browser
Expand Down Expand Up @@ -112,3 +114,7 @@ export class SocketOptions {
public keep_alive_max_failed_probes = 0) {
}
}

export function enable_logging(level: LogLevel) {
setLogLevel(level);
}
9 changes: 9 additions & 0 deletions lib/browser/mqtt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,15 @@ export class MqttClientConnection extends BufferedEventEmitter {
});
}

/**
* Queries whether the client is currently connected
*
* @returns whether the client is currently connected
*/
is_connected() : boolean {
return this.currentState == MqttBrowserClientState.Connected;
}

private on_connect = (connack: mqtt.IConnackPacket) => {
this.on_online(connack.sessionPresent);
}
Expand Down
9 changes: 9 additions & 0 deletions lib/browser/mqtt5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,15 @@ export class Mqtt5Client extends BufferedEventEmitter implements mqtt5.IMqtt5Cli
});
}

/**
* Queries whether the client is currently connected
*
* @returns whether the client is currently connected
*/
isConnected() : boolean {
return this.lifecycleEventState == Mqtt5ClientLifecycleEventState.Connected;
}

/**
* Event emitted when the client encounters a disruptive error condition. Not currently used.
*
Expand Down
661 changes: 661 additions & 0 deletions lib/browser/mqtt_request_response.spec.ts

Large diffs are not rendered by default.

Loading
Loading