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

feat(process): Pull the database at runtime #130

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Covkie
Copy link
Contributor

@Covkie Covkie commented Dec 20, 2024

This is preferred as it allows users to always have the latest db without worry & enables embedded arrpc to have the latest db without recompiling; see Vesktop or Legcord

Currently fetches if the database is 24 hours old but maybe check the headers at https://discord.com/api/v9/applications/detectable to see if it is ACTUALLY out of date

Copy link
Contributor

@CanadaHonk CanadaHonk left a comment

Choose a reason for hiding this comment

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

Do you know if this would work fine even when arrpc is bundled and/or in an asar file?

@Covkie
Copy link
Contributor Author

Covkie commented Jan 16, 2025

from the Vesktop PR: https://github.com/Vencord/Vesktop/blob/cb342c8c6875dee20937c99ffbf2414d251d4eba/patches/arrpc%403.5.0.patch

@CanadaHonk A patch would still be needed for proper location stuff but yes it does work.
Maybe when initializing arrpc you should pass the path then. Would remove the need for patches like this.

@Covkie
Copy link
Contributor Author

Covkie commented Jan 16, 2025

Also, Vee told me discord has an endpoint for fetching deltas so maybe the latency on fetching updates can be improved here. I haven't looked into it though. Nvm vee is a liar

@Vendicated
Copy link
Contributor

When fetching /applications/detectable, the response headers include the Last-Modified header

We can include the time here in our GET with the If-Modified-Since header to only fetch the database if it has changed since. If it hasn't changed, Discord will send a 304 Not Modified

image

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.

3 participants