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

Update @rails/actioncable dependency to version >=7.0 #705

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions app/assets/javascripts/turbo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5442,8 +5442,8 @@ window.Turbo = Turbo$1;
addEventListener("turbo:before-fetch-request", encodeMethodIntoRequestBody);

var adapters = {
logger: self.console,
WebSocket: self.WebSocket
logger: typeof console !== "undefined" ? console : undefined,
WebSocket: typeof WebSocket !== "undefined" ? WebSocket : undefined
};

var logger = {
Expand Down Expand Up @@ -5485,12 +5485,11 @@ class ConnectionMonitor {
isRunning() {
return this.startedAt && !this.stoppedAt;
}
recordPing() {
recordMessage() {
this.pingedAt = now();
}
recordConnect() {
this.reconnectAttempts = 0;
this.recordPing();
delete this.disconnectedAt;
logger.log("ConnectionMonitor recorded connect");
}
Expand Down Expand Up @@ -5689,6 +5688,7 @@ Connection.prototype.events = {
return;
}
const {identifier: identifier, message: message, reason: reason, reconnect: reconnect, type: type} = JSON.parse(event.data);
this.monitor.recordMessage();
switch (type) {
case message_types.welcome:
if (this.triedToReconnect()) {
Expand All @@ -5704,7 +5704,7 @@ Connection.prototype.events = {
});

case message_types.ping:
return this.monitor.recordPing();
return null;

case message_types.confirmation:
this.subscriptions.confirmSubscription(identifier);
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/turbo.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/javascripts/turbo.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@hotwired/turbo": "^8.0.12",
"@rails/actioncable": "^7.0"
"@rails/actioncable": ">=7.0"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^11.0.1",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"

"@rails/actioncable@^7.0":
version "7.1.1"
resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.1.1.tgz#e8c49769d41f35a4473133c259cc98adc04dddf8"
integrity sha512-ZRJ9rdwFQQjRbtgJnweY0/4UQyxN6ojEGRdib0JkjnuIciv+4ok/aAeZmBJqNreTMaBqS0eHyA9hCArwN58opg==
"@rails/actioncable@>=7.0":
version "8.0.100"
resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-8.0.100.tgz#83733a8fa35be5d085cf0fe10b341d0428022bc0"
integrity sha512-/vXTG6gzSW0CDqmA0hWasZ1UAGZC7g5NGM21jowh58rCCeTHAGbWwKExHn49VDuYXz+cHbL4MGfc5LMdTp9m3A==

"@rollup/plugin-node-resolve@^11.0.1":
version "11.2.1"
Expand Down
Loading