mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-30 07:05:24 +00:00
fix: wake other clients after a sync push (Plugin-Sync#1)
This commit is contained in:
1 parent
7493c0aa17
commit
691896db2d
3 files changed
+9
-2
No files matched your search
@@ -14,6 +14,7 @@
|
|||||||
- The log line for a rejected proxy login now shows the source address, so you can add it to TRUSTED_PROXY_AUTH_TRUSTED_PROXIES
|
- The log line for a rejected proxy login now shows the source address, so you can add it to TRUSTED_PROXY_AUTH_TRUSTED_PROXIES
|
||||||
- Deleting your own account now removes all of its data, like an admin delete does, instead of leaving some behind
|
- Deleting your own account now removes all of its data, like an admin delete does, instead of leaving some behind
|
||||||
- An SSH key with a passphrase is unlocked once and kept unlocked in memory for a short time, so connecting to many hosts with it no longer freezes the server for minutes
|
- An SSH key with a passphrase is unlocked once and kept unlocked in memory for a short time, so connecting to many hosts with it no longer freezes the server for minutes
|
||||||
|
- A change pushed from one linked desktop or phone now reaches your other linked devices right away, instead of on their next check a few minutes later
|
||||||
|
|
||||||
## 26.10.5
|
## 26.10.5
|
||||||
|
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ async function reconcileListeners(): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function notifyListeners(userId: string): void {
|
export function notifyListeners(userId: string): void {
|
||||||
const set = listeners.get(userId);
|
const set = listeners.get(userId);
|
||||||
if (!set) return;
|
if (!set) return;
|
||||||
for (const res of set) {
|
for (const res of set) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
} from "../store.js";
|
} from "../store.js";
|
||||||
import { allocateSeq, getRecord, putRecord, recordKey } from "../records.js";
|
import { allocateSeq, getRecord, putRecord, recordKey } from "../records.js";
|
||||||
import { orderSelfReferences } from "../wire.js";
|
import { orderSelfReferences } from "../wire.js";
|
||||||
import { reconcileUser } from "./feed.js";
|
import { markChanged, notifyListeners, reconcileUser } from "./feed.js";
|
||||||
|
|
||||||
export interface PushOp {
|
export interface PushOp {
|
||||||
entityType: string;
|
entityType: string;
|
||||||
@@ -278,6 +278,12 @@ export async function applyPush(
|
|||||||
|
|
||||||
// Refresh the snapshot so the next pull serves what was just written.
|
// Refresh the snapshot so the next pull serves what was just written.
|
||||||
await reconcileUser(userId, { force: true });
|
await reconcileUser(userId, { force: true });
|
||||||
|
// The reconcile finds nothing new, since the push wrote the records itself,
|
||||||
|
// so tell this user's other clients, and other users who may share a row.
|
||||||
|
if ([...results.values()].some((result) => result.status === "ok")) {
|
||||||
|
notifyListeners(userId);
|
||||||
|
markChanged();
|
||||||
|
}
|
||||||
return ops.map(
|
return ops.map(
|
||||||
(op) =>
|
(op) =>
|
||||||
results.get(recordKey(op.entityType, op.syncId)) ?? {
|
results.get(recordKey(op.entityType, op.syncId)) ?? {
|
||||||
|
|||||||
Reference in new issue
Block a user