ChronicStone
ChronicStone
Explore posts from servers
CDCloudflare Developers
Created by ChronicStone on 5/27/2024 in #general-help
Custom install command
@Chaika Yep exactly, sorry I didn't see there was a dedicated help page for CF page. THat's exactly what I want to do, big thanks
3 replies
CDCloudflare Developers
Created by fantuci on 7/31/2023 in #pages-help
Error deploying nuxt
Hi did you manage to solve this N
2 replies
CDCloudflare Developers
Created by crossbeau on 8/17/2023 in #pages-help
Nuxt JS on Pages environment variables not working
@crossbeau Did you find an answer ?
6 replies
TtRPC
Created by ChronicStone on 8/28/2023 in #❓-help
tRPC subscription : Access to socket ID from subscription
I strongly inspired from the ideas presented in this article : https://preciselab.io/trpc/
5 replies
TtRPC
Created by ChronicStone on 8/28/2023 in #❓-help
tRPC subscription : Access to socket ID from subscription
I managed to get this working
5 replies
TtRPC
Created by ChronicStone on 8/28/2023 in #❓-help
tRPC subscription : Access to socket ID from subscription
That's the idea of what I'm trying to do...
5 replies
TtRPC
Created by ChronicStone on 8/28/2023 in #❓-help
tRPC subscription : Access to socket ID from subscription
// wsServer.ts
const WebSocketServer = WebSocket.Server || WSWebSocketServer;
const wss = new WebSocketServer({
port: 3002,
});

const handler = applyWSSHandler({ wss, router: appRouter, createContext: () => ({}) as Context });

wss.on('connection', (ws) => {
consola.log(`➕➕ Connection (${wss.clients.size})`);
ws.once('close', () => {
consola.log(`➖➖ Connection (${wss.clients.size})`);
const storage = useStorage('db')
// HERE, SOMEHOW GET UNIQUE SOCKET ID
const socketId = ...
const linkedUserId = storage.get(socketId)

// If present linked user ID, mark user offline
if(linkedUserId) db.update(userOrganizationsTable)....

});
});

consola.log('✅ WebSocket Server listening on ws://localhost:3002');
// wsServer.ts
const WebSocketServer = WebSocket.Server || WSWebSocketServer;
const wss = new WebSocketServer({
port: 3002,
});

const handler = applyWSSHandler({ wss, router: appRouter, createContext: () => ({}) as Context });

wss.on('connection', (ws) => {
consola.log(`➕➕ Connection (${wss.clients.size})`);
ws.once('close', () => {
consola.log(`➖➖ Connection (${wss.clients.size})`);
const storage = useStorage('db')
// HERE, SOMEHOW GET UNIQUE SOCKET ID
const socketId = ...
const linkedUserId = storage.get(socketId)

// If present linked user ID, mark user offline
if(linkedUserId) db.update(userOrganizationsTable)....

});
});

consola.log('✅ WebSocket Server listening on ws://localhost:3002');
5 replies
DTDrizzle Team
Created by daniel on 6/11/2023 in #help
InferModel including relations?
@intelligently Good point, thanks
16 replies
DTDrizzle Team
Created by daniel on 6/11/2023 in #help
InferModel including relations?
Hi @danielsharvey @gerty1 Did one of you happen to have found a workaround for this ?
16 replies
DTDrizzle Team
Created by sik on 8/10/2023 in #help
how to convert serial to uuid type
Experiencing the same thing right now, did you find a fix for this ?
8 replies
DTDrizzle Team
Created by sik on 8/10/2023 in #help
how to convert serial to uuid type
Hi @sikritidakua
8 replies