Add location test to demo
There is a caveat to test this in the demo, it has to be installed for it to work.
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
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.
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.
I am marking a draft for if someone has a better solution.
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.
I believe this can be closed as https://github.com/flatpak/libportal/issues/67 is closed now.
I updated the MR so just to include the location portal test to the demo.