Skip to content

Add location test to demo#72

Open
A6GibKm wants to merge 1 commit into
flatpak:mainfrom
A6GibKm:master
Open

Add location test to demo#72
A6GibKm wants to merge 1 commit into
flatpak:mainfrom
A6GibKm:master

Conversation

@A6GibKm

@A6GibKm A6GibKm commented Jan 12, 2022

Copy link
Copy Markdown
Contributor

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

Comment thread portal-test/gtk4/window.ui Outdated
</object>
</child>
<child>
<object class="GtkLabel" id="lat">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latitudeLabel

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither this

Comment thread portal-test/gtk4/window.ui Outdated
</object>
</child>
<child>
<object class="GtkLabel" id="lon">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

longitudeLabel

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither this

Comment thread libportal/location.c Outdated
create_call_free (call);
}
else
ensure_location_updated_connected (call->portal);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ensure_location_updated_connected (call->portal);
{
ensure_location_updated_connected (call->portal);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This apparently has not been resolved

Comment thread libportal/updates.c Outdated
Comment on lines +345 to +348
{
ensure_update_monitor_connection (call->portal);
g_task_return_boolean (call->task, TRUE);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  if (error)
    {
      g_task_return_error (call->task, error);
    }
  else
   {
     ensure_update_monitor_connection (call->portal);
     g_task_return_boolean (call->task, TRUE);
   }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither this one

@smcv

smcv commented Jan 12, 2022

Copy link
Copy Markdown
Contributor

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

@A6GibKm

A6GibKm commented Jan 12, 2022

Copy link
Copy Markdown
Contributor Author

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

A6GibKm commented Jan 12, 2022

Copy link
Copy Markdown
Contributor Author

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 A6GibKm changed the title Fixes location and updates signal emissions WIP: Fixes location and updates signal emissions Jan 12, 2022
@A6GibKm A6GibKm marked this pull request as draft January 12, 2022 14:32
@A6GibKm

A6GibKm commented Jan 12, 2022

Copy link
Copy Markdown
Contributor Author

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

@A6GibKm

A6GibKm commented Jan 12, 2022

Copy link
Copy Markdown
Contributor Author

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.

@grulja

grulja commented Jan 13, 2022

Copy link
Copy Markdown
Contributor

I believe this can be closed as #67 is closed now.

@A6GibKm

A6GibKm commented Jan 13, 2022

Copy link
Copy Markdown
Contributor Author

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

@A6GibKm A6GibKm changed the title WIP: Fixes location and updates signal emissions Add location test to demo Jan 13, 2022
@A6GibKm A6GibKm marked this pull request as ready for review January 13, 2022 12:17
Comment thread libportal/location.c Outdated
create_call_free (call);
}
else
ensure_location_updated_connected (call->portal);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This apparently has not been resolved

Comment thread libportal/updates.c Outdated
Comment on lines +345 to +348
{
ensure_update_monitor_connection (call->portal);
g_task_return_boolean (call->task, TRUE);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither this one

Comment thread portal-test/gtk4/window.ui Outdated
</object>
</child>
<child>
<object class="GtkLabel" id="lon">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither this

Comment thread portal-test/gtk4/window.ui Outdated
</object>
</child>
<child>
<object class="GtkLabel" id="lat">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither this

See https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/201.
Generated by
https://gitlab.gnome.org/World/design/emblem/-/merge_requests/40.

The icon used was portal-symbolic from the devkit, using colors #26A269
to #33D17A were taken from the source of the SVG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants