File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -81,11 +81,14 @@ export class BlockService extends BaseService<
8181 subscribe ( @SocketReq ( ) req : SocketRequest , @SocketRes ( ) res : SocketResponse ) {
8282 try {
8383 if ( req . session . web ?. profile ?. id ) {
84- this . gateway . io . socketsJoin ( `blocks:${ req . session . web . profile . id } ` ) ;
84+ const room = `blocks:${ req . session . web . profile . id } ` ;
85+ this . gateway . io . socketsJoin ( room ) ;
86+ this . logger . log ( 'Subscribed to socket room' , room ) ;
8587 return res . status ( 200 ) . json ( {
8688 success : true ,
8789 } ) ;
8890 } else {
91+ this . logger . error ( 'Unable to subscribe to highlight blocks room' ) ;
8992 throw new Error ( 'Unable to join highlight blocks room' ) ;
9093 }
9194 } catch ( e ) {
Original file line number Diff line number Diff line change @@ -413,14 +413,15 @@ export class WebsocketGateway
413413 async handleHighlightBlock (
414414 payload : IHookOperationMap [ 'highlight' ] [ 'operations' ] [ 'block' ] ,
415415 ) {
416+ this . logger . log ( 'highlighting block' , payload ) ;
416417 this . io . to ( `blocks:${ payload . userId } ` ) . emit ( 'highlight:block' , payload ) ;
417418 }
418419
419420 @OnEvent ( 'hook:highlight:error' )
420421 async highlightBlockErrored (
421422 payload : IHookOperationMap [ 'highlight' ] [ 'operations' ] [ 'error' ] ,
422423 ) {
423- this . logger . warn ( 'hook:highlight:error ' , payload ) ;
424+ this . logger . warn ( 'hook:highlight:error' , payload ) ;
424425 this . io . to ( `blocks:${ payload . userId } ` ) . emit ( 'highlight:error' , payload ) ;
425426 }
426427}
Original file line number Diff line number Diff line change @@ -41,10 +41,7 @@ export const SocketProvider = (props: PropsWithChildren) => {
4141 const [ connected , setConnected ] = useState ( false ) ;
4242 const { toast } = useToast ( ) ;
4343 const { user } = useAuth ( ) ;
44- const socket = useMemo (
45- ( ) => new SocketIoClient ( apiUrl , { auth : user } ) ,
46- [ apiUrl ] ,
47- ) ;
44+ const socket = useMemo ( ( ) => new SocketIoClient ( apiUrl ) , [ apiUrl ] ) ;
4845
4946 useEffect ( ( ) => {
5047 if ( user && apiUrl )
You can’t perform that action at this time.
0 commit comments