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

Database is inconsistent about QString and QByteArray, causing a high risk of bugs #773

Open
TobiasFella opened this issue Jul 15, 2024 · 1 comment
Labels
enhancement A feature or change request for the library

Comments

@TobiasFella
Copy link
Member

When storing keys in the database, libQuotient sometimes uses QByteArray and sometimes QString, depending on the type the variable has in the C++ code. When trying to load a key that was stored as a byte array as a string (or vice-versa), the result is empty, leading to unexpected and very difficult to figure out bugs.

A future database migration should

  • Migrate all existing keys from byte arrays to strings
  • Change all existing code to read and write strings
  • Ideally also adjust API to make sure that we keep keys as strings as much as possible
@TobiasFella TobiasFella added the enhancement A feature or change request for the library label Jul 15, 2024
@KitsuneRal
Copy link
Member

Yeah, I guess this would be the best way out, the savings from using QByteArray in this context are tiny if exist at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or change request for the library
Projects
None yet
Development

No branches or pull requests

2 participants