Working single post rendering

This commit is contained in:
2026-02-17 07:43:51 +00:00
parent 3a056dffce
commit 0d392c90cc
7 changed files with 36 additions and 25 deletions

View File

@@ -236,9 +236,18 @@ export class App {
for (let userID of userIDs) {
// console.log.apply(null, log(`[app] announceUsers, got user:${userID} from peer ${sendingPeerID}`));
this.sync.addUserPeer(userID, sendingPeerID);
if (!(this.sync.shouldSyncUserID(userID) || (this.router.route & (App.Route.USER | App.Route.POST) && userID === this.router.userID))) {
console.log.apply(null, log(`[app] announceUser_rpc_response skipping user[${logID(userID)}] from[${logID(sendingPeerID)}]`));
continue;
const isUserOrPostRoute = (this.router.route & (App.Route.USER | App.Route.POST)) !== 0;
if (isUserOrPostRoute) {
if (userID !== this.router.userID) {
continue;
}
} else {
if (!this.sync.shouldSyncUserID(userID)) {
console.log.apply(null, log(`[app] announceUser_rpc_response skipping user[${logID(userID)}] from[${logID(sendingPeerID)}]`));
continue;
}
}
console.log.apply(null, log(`[app] calling getPostIDsForUser for user [${logID(userID)}] on peer [${logID(sendingPeerID)}]`));
@@ -1091,7 +1100,10 @@ export class App {
let posts: StoragePost[] = [];
if (postID) {
posts = await getPostForUser(userID, postID);
const post = await getPostForUser(userID, postID);
posts = post ? [post] : [];
} else {
posts = await getData(userID, new Date(2022, 8), new Date());
}

View File

@@ -538,7 +538,7 @@ class PeerConnection {
private chunkSize = (16 * 1024) - 100;
messageSuperlog: boolean = false;
sendQueueSuperLog: boolean = false;
rpcSuperlog: boolean = true;
rpcSuperlog: boolean = false;
pendingRPCs: Map<
string,
{ resolve: Function; reject: Function; functionName: string }
@@ -553,12 +553,7 @@ class PeerConnection {
static config = {
iceServers: [
{ urls: "stun:ddln.app" },
// { urls: "turn:ddln.app", username: "a", credential: "b" },
{ urls: "stun:stun.l.google.com" }, // keeping this for now as my STUN server is not returning ipv6
{ urls: "stun:stun1.l.google.com" },
//{ urls: "stun:stun2.l.google.com" },
//{ urls: "stun:stun3.l.google.com" },
//{ urls: "stun:stun4.l.google.com" },
{ urls: "turn:ddln.app", username: "ddln1", credential: "ddln1" },
],
};
// longMessageQueue: string[] = [];