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

[4.3] SUPP-33: fix import/delete rates #6677

Merged
merged 9 commits into from
Dec 18, 2020
Merged

[4.3] SUPP-33: fix import/delete rates #6677

merged 9 commits into from
Dec 18, 2020

Conversation

icehess
Copy link
Contributor

@icehess icehess commented Dec 17, 2020

Fix import/delete rates in tasks app and cb_rates.

  • fix import where ratedeck database was incorrectly formatted (like ratedeck/) because of
    ratedeck_id being an empty binary from CSV
  • fix delete returning result which causing crashes in kt_task_worker
  • in delete, group objects by db, also add better logging
  • convert import state to map
  • make a clean json to save to db: CSV missing fields are empty binary. Together with changes in kzd_rates make
    sure we are generating a clean JSON to be saved to db.
  • try to update rate doc on conflict: When a user deletes the rates from ratedeck db, it is soft deleted by default. This commit will try to update and ensure save the doc even if it is deleted.
  • fix kzd_rates accessors return empty binary: Tasks app CSV has empty binary for all fields that are missing from uploaded CSV. This will cause kzd_rates to always return empty string and doc save with them in db. This will make sure all accessros has correct type ne_binary and handle situation when the value is empty binary so we save a clean JSON in db.

Tasks app CSV has empty binary for all fields that are missing from uploaded CSV.
This will cause kzd_rates to always return empty string and doc save with them
in db.

This will make sure all accessros has correct type ne_binary and handle
situation when the value is empty binary so we save a clean JSON in db.
When a user deletes the rates from ratedeck db, it is soft deleted by default.
This commit will try to update and ensure save the doc even if it is deleted.
During testing the rate import and delete tasks for SUPP-33, some errors were found.

* fix import where ratedeck database was incorrectly formatted (like `ratedeck/`) because of
  `ratedeck_id` being an empty binary from CSV
* fix delete returning result which causing crashes in `kt_task_worker`
* in delete, group objects by db, also add better logging
* convert import state to map
* make a clean json to save to db: CSV missing fields are empty binary. Together with changes in kzd_rates make
sure we are generating a clean JSON to be saved to db.
open_doc will ignore if pvt_deleted so update_doc will result in conflict again.
Adding option to allow pvt_deleted doc.

Also remove any previous pvt_deleted from doc on conflict save
@holy-batman holy-batman merged commit ed9bc87 into 4.3 Dec 18, 2020
@holy-batman holy-batman deleted the SUPP-33 branch December 18, 2020 23:23
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.

2 participants