Yaffle / EventSource

a polyfill for http://www.w3.org/TR/eventsource/
MIT License
2.13k stars 337 forks source link

Need help for Adobe UXP #214

Open fire1 opened 1 year ago

fire1 commented 1 year ago

Hi!

I'm trying to add a connection to the Mercure hub from the Adobe UXP plugin, it seems to connect, but cannot receive any message from the hub. (Topic is same)

2023-02-09T09:51:45.218+0200    INFO    mercure/subscribe.go:137        New subscriber  {"subscriber": {"id": "urn:uuid:7f783236-c799-4118-8cb3-1aeadc0d5b66", "last_event_id": "", "remote_addr": "127.0.0.1:57685", "topics": ["test"]}}
2023-02-09T09:51:50.554+0200    INFO    mercure/publish.go:79   Update published        {"update": {"id": "urn:uuid:ce15199e-aa76-486e-8a8c-a533ec5b1019", "type": "", "retry": 0, "topics": ["test"], "private": false, "data": "{\"hello\":\"there\"}"}, "remote_addr": "127.0.0.1:57692"}
127.0.0.1 - - [09/Feb/2023:09:51:50 +0200] "POST /.well-known/mercure HTTP/1.1" 200 45 "" "Symfony HttpClient/Curl"
2023-02-09T09:51:50.554+0200    INFO    mercure/subscribe.go:86 Update sent     {"subscriber": {"id": "urn:uuid:7f783236-c799-4118-8cb3-1aeadc0d5b66", "last_event_id": "", "remote_addr": "127.0.0.1:57685", "topics": ["test"]}, "update": {"id": "urn:uuid:ce15199e-aa76-486e-8a8c-a533ec5b1019", "type": "", "retry": 0, "topics": ["test"], "private": false, "data": "{\"hello\":\"there\"}"}}
2023-02-09T09:52:30.556+0200    DEBUG   mercure/subscribe.go:53 connection closed by the client {"subscriber": {"id": "urn:uuid:7f783236-c799-4118-8cb3-1aeadc0d5b66", "last_event_id": "", "remote_addr": "127.0.0.1:57685", "topics": ["test"]}}
2023-02-09T09:52:30.556+0200    INFO    mercure/subscribe.go:234        Subscriber disconnected {"subscriber": {"id": "urn:uuid:7f783236-c799-4118-8cb3-1aeadc0d5b66", "last_event_id": "", "remote_addr": "127.0.0.1:57685", "topics": ["test"]}}
127.0.0.1 - - [09/Feb/2023:09:51:45 +0200] "GET /.well-known/mercure?topic=test HTTP/1.1" 200 79 "" "UXP:XMLHttpRequest"
2023-02-09T09:52:31.262+0200    INFO    mercure/subscribe.go:137        New subscriber  {"subscriber": {"id": "urn:uuid:261c5462-a14c-4878-97c5-24ffe3755971", "last_event_id": "", "remote_addr": "127.0.0.1:57727", "topics": ["test"]}}

It should work since they have some internal class that provides socket connection WebSocket

Any suggestions on how to proceed, or just to scrap this plugin for a later time?

Yaffle commented 1 year ago

@fire1 , you could try to use WebSocket as a transport like at https://github.com/Yaffle/EventSource/issues/87#issuecomment-562852095

fire1 commented 1 year ago

@fire1 , you could try to use WebSocket as a transport like at #87 (comment)

I'll give it a try, but with little hope... Аll I see currently working in UXP is from a timeout, even a socket content is there, (even heartbeat). For me, UXP request does not support "stream-like" responses. Thanks for the suggestion, will report back after the tests

EDIT: WebSocketTransport not defined

fire1 commented 1 year ago

Hi again, what is the minim version to support this polyfill, from what I check, UXP is based on javascript ES3, (or maybe even older...) but also running on Chromium ...??? I can't even begin to imagine what a mess Adobe has made and how this is possible!

Besides, great work! Your polyfill is best working so far...

Yaffle commented 1 year ago

@fire1 ES5, may be ES3