@decentnetwork/beagle 0.1.93 → 0.1.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/desktop/app.js +1 -1
- package/dist/server.js +7 -4
- package/package.json +1 -1
package/dist/desktop/app.js
CHANGED
package/dist/server.js
CHANGED
|
@@ -2016,6 +2016,7 @@ export function startBeagleServer(opts) {
|
|
|
2016
2016
|
const sess = sessByUserid.get(uid);
|
|
2017
2017
|
const status = f.status;
|
|
2018
2018
|
const stamp = stamps.get(uid);
|
|
2019
|
+
const acceptedAt = f.lastSeen ?? stamp?.acceptedAt ?? 0;
|
|
2019
2020
|
const online = status === "connected" || status === "online";
|
|
2020
2021
|
const realName = typeof f.name === "string" && f.name !== uid ? f.name : undefined;
|
|
2021
2022
|
const lm = f.lastMessage;
|
|
@@ -2029,11 +2030,13 @@ export function startBeagleServer(opts) {
|
|
|
2029
2030
|
online,
|
|
2030
2031
|
// Friendship not yet accepted by the other side. Only trusted when
|
|
2031
2032
|
// the backend states it explicitly: the embedded host's `accepted`,
|
|
2032
|
-
// or the SDK status "requested"
|
|
2033
|
-
//
|
|
2033
|
+
// or — on the daemon — SDK status "requested" WITH no acceptedAt.
|
|
2034
|
+
// Status alone is not enough: the daemon keeps "requested" on a
|
|
2035
|
+
// friend who accepted but has never connected since, and reading
|
|
2036
|
+
// it as pending put the waiting banner on 22 of 65 friends.
|
|
2034
2037
|
// Anything else defaults to established, so the banner can never
|
|
2035
2038
|
// wrongly appear on an old backend.
|
|
2036
|
-
pending: f.accepted === false || status === "requested",
|
|
2039
|
+
pending: f.accepted === false || (status === "requested" && !acceptedAt),
|
|
2037
2040
|
via: online ? viaFromTransport(sess?.transport) : null,
|
|
2038
2041
|
ping: null,
|
|
2039
2042
|
ip: ipByUserid.get(uid) ?? "",
|
|
@@ -2058,7 +2061,7 @@ export function startBeagleServer(opts) {
|
|
|
2058
2061
|
// daemon backend gives only lastSeen (its acceptedAt) and nothing
|
|
2059
2062
|
// for a request we sent, which left a just-added friend with no
|
|
2060
2063
|
// stamp at all.
|
|
2061
|
-
acceptedAt
|
|
2064
|
+
acceptedAt,
|
|
2062
2065
|
requestedAt: f.requestedAt ?? stamp?.requestedAt ?? 0,
|
|
2063
2066
|
wire: "163",
|
|
2064
2067
|
avatarUrl: ensPub.get(uid)?.avatarUrl ?? null,
|
package/package.json
CHANGED