lgi-devs / lgi-devs/lgi

Async functions are not present for libsecret until you trigger something by getting a real one

Open
#203 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
491
Forks
81
PR merge metrics
No merged PRs in 30d

Description

Given that lua -v outputs Lua 5.3.4 and require 'lgi' ._VERSION - 0.9.2 here is how i can replicate it

In lua repl:

> lgi = require 'lgi'
> secret = lgi.Secret
> secret.async_password_lookup
nil
> secret.async_password_store -- or any other async function with async prefix
nil
> secret.password_lookup -- trigger the real one (in libsecret they are with _sync counterparts btw)
lgi.fun (0x7fac873f03a0): Secret.password_lookup
> secret.async_password_lookup
function: 0x24a8410
> secret.async_password_store
function: 0x2530810

Got this in my awesome setup, had to fix it with:

do local _ = secret.password_lookup end

Gio doesn't have that behavior and i don't know glib enough yet to know where there are other async function to try this with.
I am guessing that this is because Gio has _async suffix and no suffix for sync functions, but libsecret has no suffix and _sync suffix for sync functions - pure guess, might be totally wrong.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Lua REPL sequence from the issue with lgi 0.9.2, comparing libsecret's async and sync method naming with Gio's behavior. Trace how the binding exposes introspected methods and verify that libsecret async functions are available before accessing their synchronous counterparts.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.