Skip to content
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

Update everything to conform the 0.3.0 DBus spec #9

Merged
merged 13 commits into from
Jan 11, 2024

Conversation

topjor
Copy link
Contributor

@topjor topjor commented Nov 28, 2023

Description

This merge request fixes the dbus API to be in line with the spec (this package was never updated from 0.2.0 to 0.3.0).
This comprises of the registration (distributor) and message (connector) signature. This is/was a breaking change.

Noteworthy changes

General

This merge request changes the initialization from just the long app name (reverse FQDN format) and a callback class to include a friendly application name as second parameter (moving the callback class to the third)

This friendly name is used when registering in combination with the instance given by the app to generate a nice description for the notification session. (Allowing distributors to display a user friendly list of registrations.)

A second registration function is added to allow overriding the description by the application itself

Internal changes

The description field is added to the 'instance' object in the store.

The generation and retrieval of tokens / 'instance' objects is changed to return the 'instance' so the description is also available when registering.

Internally the description is currently only set the first time an 'instance' / token is generated. During registration the description is simply taken from the 'instance' object.

saveNewToken() is renamed to generateNewToken() to convey the generation and not just storing of a token

Progress

  • Registration changes
    • Update internal dbus call and required changes (description field)
    • Update registration return checking (return status string change)
    • Update C api
    • Update golang example
    • Update C example
    • Add function to register with an explicitly given description
  • Message changes
    • Update golang API
    • Update C api
    • Update golang example
    • Update C example

Fixes #8

@topjor topjor marked this pull request as ready for review November 28, 2023 22:01
@topjor topjor changed the title [WIP] Updated registration based on latest dbus spec Updated registration based on latest dbus spec Nov 28, 2023
@topjor topjor marked this pull request as draft December 1, 2023 23:54
@topjor topjor changed the title Updated registration based on latest dbus spec Update everything to conform the 0.3.0 DBus spec Dec 1, 2023
@topjor
Copy link
Contributor Author

topjor commented Dec 2, 2023

Continuing my proof of concept I found the message definition got also changed with the spec change of 0.3.0.
I have decided to change this PR from updating the registration to updating everything that is needed for the spec update.
I have marked this back as a draft, updated the description and todo list accordingly. I will not change the original issue or create a new one.

@topjor topjor marked this pull request as ready for review December 25, 2023 14:02
@topjor
Copy link
Contributor Author

topjor commented Dec 25, 2023

Everything is now updated to the v0.3.0 spec, and a method is added for registering with a description

For testing the golang example, there is one change that does not really belong in this fix: the replace directive in go.mod should be changed to replace unifiedpush.org/go/dbus_connector => ../../ so it uses the version provided from the parent directory instead of the published version online.

I tested both examples with my fake distributor: https://gitlab.com/j0dev/rust/rust-unifiedpush-example-distributor

Next on the TODO is updating the documentation on the website

@karmanyaahm
Copy link
Member

Looks good to me! Thank you so much for doing this

@karmanyaahm karmanyaahm merged commit bc0df18 into UnifiedPush:main Jan 11, 2024
1 check passed
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.

distributor register dbus call does not adhere to the specification
2 participants