-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data flow persists even after closing the downlink #156
Comments
Hi @cyanaryan The issue is that Swim consolidates the builder pattern for downlinks into the same class, which is convenient for the common-case (to avoid a separate builder class) but can lead to some awkward behavior. In your case, the "downlink" (really a "DownlinkBuilder" since it's incomplete) returned by:
is actually separate from the downlink returned by the subsequent Easiest thing to do is to do it all in one chained step:
If the I'll leave the issue open in case this doesn't address it, so please let me know if this worked for you. |
Hi @brohitbrose I tried this above solution. Actually, during some investigation, I find out that the problem is something else.
Notice in the above nodeUri, it has a forward slash. When I open this downlink, I get the following response I am getting the correct response. But when I try to close it. I get this below request Notice in the above request that, the forward slash is missing in here. I haven't done any changes in the uri. Is there any way on how to update the node_uri. Also why the forward slash is missing in here? |
Hi @cyanaryan
This sounds like a bug in certain versions of swim-js that would take place
if the hostUri is structured a certain way (most usually, but not
necessarily, when there is some overlap with the nodeUri). The latest
versions should not have this issue but I understand that upgrading may be
incompatible with the Javascript version in your environment.
Can you confirm which version you are using and what value your hostUri
takes?
…On Thu, Jan 18, 2024 at 3:28 AM cyanaryan ***@***.***> wrote:
Hi @brohitbrose <https://github.com/brohitbrose>
I tried this above solution. Actually, during some investigation, I find
out that the problem is something else.
this.demoDownlink = host
.downlinkValue()
.nodeUri('/org/demo_node_uri/org')
.laneUri('demo_lane_uri')
.didSet((value) => {
console.log(value.stringValue());
}).open();
// Closing the downlink after use
this.demoDownlink.close();
Notice in the above *nodeUri*, it has a forward slash.
When I open this downlink, I get the following response
@sync <https://github.com/sync>
(node:"/org/demo_node_uri/org",lane:"demo_lane_uri")
@linked <https://github.com/linked>
(node:"/org/demo_node_uri/org",lane:"demo_lane_uri")
@event <https://github.com/event>
(node:"/org/demo_node_uri/org",lane:"demo_lane_uri")["......"]
@synced <https://github.com/synced>
(node:"/org/demo_node_uri/org",lane:"demo_lane_uri")
I am getting the correct response. But when I try to close it. I get this
below request
@Unlink <https://github.com/Unlink>
(node:"org/demo_node_uri/org",lane:"demo_lane_uri")
Notice in the above request that, the forward slash is missing in here. I
haven't done any changes in the uri. Is there any way on how to update the
node_uri. Also why the forward slash is missing in here?
—
Reply to this email directly, view it on GitHub
<#156 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQKTJDILRUP4IS3VRSON5TYPEBPRAVCNFSM6AAAAABB6SWZ5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYGMYDCOJSGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @brohitbrose We are using But there are lots of imports error. I think there was major change when switching to above version. |
@cyanaryan we may have to hack around it a bit since you're probably going to be unable to upgrade the version in your environment. What is the value of the hostUri that you are connecting to? This information will tell us whether the bug is the one that we think it is and how we might need to proceed. |
@brohitbrose |
@cyanaryan In this early version of swim, having a path component in the hostUri (in your case the final
Please let us know which solution you'd like to proceed with. |
@brohitbrose |
@cyanaryan Ideally the hostUri would have no path components (only protocol and domain and possibly a port at most), so in your case it would end in the If you have this level of flexibility then this will be the quickest fix. Otherwise we will have to patch your version. |
Hi @brohitbrose
|
|
@ajay-gov
So the ControllerView has been removed from the @swim/ui. So what to use in alternative to that? |
@cyanaryan Sorry about this. We will give you a working example of how to use maps with the new version. Will have it for you in a few days. Thanks |
Sure @ajay-gov . |
Any update regarding the working example? |
Hi @ajay-gov We are getting memory leak due to several downlinks being open. If possible, could you please update us about the documentation. |
Hi @ajay-gov / @brohitbrose We got the patched version file (got the swim-runtime zip file). In the mail response, it's mentioned that we need to update swim-core and swim-host in that. Do we have to update only the swim-core and swim-host to the version Below is the mail response from the swim team This is a patched version, requires an updated swim-core and swim-host js. Here it is bundled as swim-runtime.zip (includes a unminified version, minified version with the sourcemap as well). Can you give it to your team and ask them to try to see if it fixes the issue. If it does then we can figure out how to package and publish based on your team's needs? Process I followed:
HOST uri value ---> PS: in the mail attachment we got 4 files |
@cyanaryan yes please replace the |
@ajay-gov |
The version we gave you in the zip file is not 4.0.0-dev.20230923. It is a patch version, it has the fix to send the right unlink message so that it stops the data flow once you close the downlink. This patch version is built on top of |
So I replaced the js file present in the swim-core and swim-host, with the content present in swim-runtime folder. Still the Steps I followed:
PFA the screenshot |
The fix involves changes to two files.
Can you please check to see you have those changes in the js file you are using to test the fix? We can confirm that this works on our end. If you have those changes and it still doesn't work then let us get on a call to sort this out. |
I updated If possible could we connect over call to resolve it. Let me know when you will be available. |
@cyanaryan can you send me an email with your email address, we can coordinate over email My email is: ajay@nstream.io |
Issue is fixed. Closing the bug. Swim is upgraded to 4.0.0-dev.20210927.3 (patched version) which has fix. |
…olkit (includes patch of UriPath and RemoteHost that addresses issue #156)
I wanted to know about how to close the downlink so that it gets terminated and the data flow stops from that downlink.
Like for example I am using one downlink. ( I am using javascript)
When I open this downlink and see the Network tab..below 4 message come (which is all fine).
@sync(node:"demo_node_uri",lane:"demo_lane_uri")
@linked(node:"demo_node_uri",lane:"demo_lane_uri")
@event(node:"demo_node_uri",lane:"demo_lane_uri")["......"]
@synced(node:"demo_node_uri",lane:"demo_lane_uri")
When I try to close the downlink with the command
this.demoDownlink.close();
. Then below message is sent.@Unlink(node:"demo_node_uri",lane:"demo_lane_uri")
But after sometime I still get the event message of the the closed downlink and it gets coming every time.
@event(node:"demo_node_uri",lane:"demo_lane_uri")["......"]
Also, when I try to again open the same laneUri, it only gives me the event message (and no sync, linked, event, synced).
Is there something I am missing? Can anyone give me an example on how to properly close the above downlink?
The text was updated successfully, but these errors were encountered: