EventSource icon indicating copy to clipboard operation
EventSource copied to clipboard

Need help for Adobe UXP

Open fire1 opened this issue 1 year ago • 4 comments

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?

fire1 avatar Feb 09 '23 07:02 fire1

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

Yaffle avatar Feb 09 '23 10:02 Yaffle

@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 avatar Feb 09 '23 10:02 fire1

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...

fire1 avatar Feb 09 '23 12:02 fire1

@fire1 ES5, may be ES3

Yaffle avatar Feb 09 '23 14:02 Yaffle