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

Contribution queue is not cleared #7579

Closed
NejcZdovc opened this issue Jan 3, 2020 · 1 comment · Fixed by brave/brave-core#4347
Closed

Contribution queue is not cleared #7579

NejcZdovc opened this issue Jan 3, 2020 · 1 comment · Fixed by brave/brave-core#4347

Comments

@NejcZdovc
Copy link
Contributor

Description

Some users reported that their balance was reduced to 0 and multiple contributions happened. We don't have steps, but while debugging with @yachtcaptain23 I saw this error

[11430:11447:0101/233510.990260:ERROR:database.cc(1581)] publisher_info_db sqlite error 1, errno 0: no such table: main.publisher_info_old, sql: DELETE FROM contribution_queue WHERE contribution_queue_id = ?

Based on this error I investigated more and found that problem is in foreign key, that was not migrated correctly and is referencing table that doesn't exist (in the example "publisher_info_old"). Example of corrupted schema:

CREATE TABLE contribution_queue_publishers (contribution_queue_id INTEGER NOT NULL,publisher_key TEXT NOT NULL,amount_percent DOUBLE NOT NULL,CONSTRAINT fk_contribution_queue_publishers_publisher_key     FOREIGN KEY (publisher_key)     REFERENCES "publisher_info_old" (publisher_id),CONSTRAINT fk_contribution_queue_publishers_id     FOREIGN KEY (contribution_queue_id)     REFERENCES contribution_queue (contribution_queue_id)     ON DELETE CASCADE);

To fix this we will drop foreign key constrain and manually delete publishers related to the queue

Steps to Reproduce

NA

Actual result:

Queue is not deleted

Expected result:

Queue should be deleted

Reproduces how often:

Brave version (brave://version info)

Version/Channel Information:

  • Can you reproduce this issue with the current release?
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the dev channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
  • Does the issue resolve itself when disabling Brave Rewards?
  • Is the issue reproducible on the latest version of Chrome?

Miscellaneous Information:

@NejcZdovc NejcZdovc added feature/rewards priority/P1 A very extremely bad problem. We might push a hotfix for it. QA/Yes QA/Blocked labels Jan 3, 2020
@NejcZdovc NejcZdovc added this to the 1.2.x - Release milestone Jan 3, 2020
@NejcZdovc NejcZdovc self-assigned this Jan 3, 2020
NejcZdovc added a commit to brave/brave-core that referenced this issue Jan 3, 2020
@kjozwiak kjozwiak closed this as completed Jan 3, 2020
NejcZdovc added a commit to brave/brave-core that referenced this issue Jan 4, 2020
@NejcZdovc NejcZdovc changed the title Contribution queue is not cleared Contribution queue is not cleared (1.2 and 1.3) Jan 4, 2020
@kjozwiak
Copy link
Member

kjozwiak commented Jan 6, 2020

Verification PASSED on macOS 10.15.2 x64 using the following build:

Brave 1.2.41 Chromium: 79.0.3945.88 (Official Build) (64-bit)
Revision c2a58a36b9411c80829b4b154bfcab97e581f1f3-refs/branch-heads/3945@{#954}
OS macOS Version 10.15.2 (Build 19C57)

Verification PASSED on Win 10 x64 using the following build:

Brave 1.2.41 Chromium: 79.0.3945.88 (Official Build) (64-bit)
Revision c2a58a36b9411c80829b4b154bfcab97e581f1f3-refs/branch-heads/3945@{#954}
OS Windows 10 OS Version 1909 (Build 18363.535)

Verification passed on

Brave 1.2.41 Chromium: 79.0.3945.88 (Official Build) (64-bit)
Revision c2a58a36b9411c80829b4b154bfcab97e581f1f3-refs/branch-heads/3945@{#954}
OS Linux

@NejcZdovc NejcZdovc changed the title Contribution queue is not cleared (1.2 and 1.3) Contribution queue is not cleared Jan 9, 2020
NejcZdovc added a commit to brave/brave-core that referenced this issue Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants