libportal icon indicating copy to clipboard operation
libportal copied to clipboard

Add location test to demo

Open A6GibKm opened this issue 4 years ago • 7 comments

There is a caveat to test this in the demo, it has to be installed for it to work.

A6GibKm avatar Jan 12 '22 14:01 A6GibKm

If done too soon it won't work

In what way does it not work?

I'm cautious about this because delaying a D-Bus signal connection until after a successful method call often leads to this anti-pattern:

  • client: call GetThing()
  • server: reply GetThing() -> 23
  • server: emit ThingChanged(to: 42)
  • client: receive reply GetThing() -> 23
  • client: subscribe to ThingChanged
  • too late! client will never find out that Thing changed to 42

smcv avatar Jan 12 '22 14:01 smcv

If done too soon it won't work

In what way does it not work?

I'm cautious about this because delaying a D-Bus signal connection until after a successful method call often leads to this anti-pattern:

* client: call GetThing()

* server: reply GetThing() -> 23

* server: emit ThingChanged(to: 42)

* client: receive reply GetThing() -> 23

* client: subscribe to ThingChanged

* too late! client will never find out that Thing changed to 42

It does not work in the sense that LocationUpdated will never be emitted on the other side of the DBus.

A6GibKm avatar Jan 12 '22 14:01 A6GibKm

I am not convinced this is the solution, but before this changes the location portal would fail about 19/20 times, now it only fails about 1/8 of times.

A6GibKm avatar Jan 12 '22 14:01 A6GibKm

I am marking a draft for if someone has a better solution.

A6GibKm avatar Jan 12 '22 14:01 A6GibKm

I think ill close it, it does not work on my other machine. This issue is the weirdest condition race I have ever seen.

All I know this issue is in libportal side since, ASHPD works in a reliable way.way.

A6GibKm avatar Jan 12 '22 15:01 A6GibKm

I believe this can be closed as https://github.com/flatpak/libportal/issues/67 is closed now.

grulja avatar Jan 13 '22 12:01 grulja

I updated the MR so just to include the location portal test to the demo.

A6GibKm avatar Jan 13 '22 12:01 A6GibKm