br41nslug / directus-websocket-subscribe

An extension to subscribe to directus updates over a websocket.
MIT License
106 stars 13 forks source link

Directus 9.22.4 breaks /websocket route #14

Closed cliqer closed 1 year ago

cliqer commented 1 year ago

Directus 9.22.4 breaks /websocket route

1|api  | 2023-01-12T13:50:34: [13:50:33.871] DEBUG: Route /websocket doesn't exist.
1|api  | 2023-01-12T13:50:34:     err: {
1|api  | 2023-01-12T13:50:34:       "type": "RouteNotFoundException",
1|api  | 2023-01-12T13:50:34:       "message": "Route /websocket doesn't exist.",
1|api  | 2023-01-12T13:50:34:       "stack":
1|api  | 2023-01-12T13:50:34:           Error: Route /websocket doesn't exist.
1|api  | 2023-01-12T13:50:34:               at notFound (/var/www/api/node_modules/directus/dist/controllers/not-found.js:31:14)
1|api  | 2023-01-12T13:50:34:       "status": 404,
1|api  | 2023-01-12T13:50:34:       "code": "ROUTE_NOT_FOUND",
1|api  | 2023-01-12T13:50:34:       "extensions": {}
1|api  | 2023-01-12T13:50:34:     }
br41nslug commented 1 year ago

I've just updated for 9.22.4 :) the rebuilt version seems to be working

cliqer commented 1 year ago

Thank you for that, but unfortunately, it doesn't; or it may be just me. There must be a breaking change with the extension hooks and how they register as the WebSocket server opens and connects inbound to the server, but it doesn't outbound any data. Try to subscribe from a client and change something on directus.

br41nslug commented 1 year ago

Does the extension load properly? and do you have any configurations that could be interfering? image

cliqer commented 1 year ago

Indeed, it was on my end. After directus update/migrate, something got messed up and had to disable and re-enable the Permissions on the public role. Then everything came back to normal