-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fixed deleting entities from lists with special characters #6561
base: v2024.3.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should target v2024.3.x
instead of master
as we want to put it out as a hotfix.
d8a5328
to
d0fb959
Compare
Fixed. |
repository.save("wines.x", leoville) | ||
repository.save("wines-x", leoville) | ||
|
||
repository.delete("1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes me realize that delete
should probably take a list as an arg as well, but that's for another time!
@@ -198,7 +198,7 @@ class DatabaseEntitiesRepository(context: Context, dbPath: String) : EntitiesRep | |||
databaseConnection.withConnection { | |||
getLists().forEach { | |||
writableDatabase.delete( | |||
it, | |||
"`$it`", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to use backticks here instead of quotes like in the rest of the file?
Closes #6559
Why is this the best possible solution? Were any other approaches considered?
We need to quote the list name to make it possible to use special characters in table names in SQL. It's not the first issue like that so this approach is the same as it was before in the case of similar problems.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
We’ve encountered issues with handling special characters in entities in other areas before, so this isn’t a new problem. Please test it as described in the issue (deleting entities), but keep in mind that this might not be the last case we’ll need to address.
Do we need any specific form for testing your changes? If so, please attach one.
Any form with entities where lists contain special characters like
.
or-
.Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still passDateFormatsTest