-
Notifications
You must be signed in to change notification settings - Fork 32
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
Changes to duplicate handling #37
base: master
Are you sure you want to change the base?
Conversation
…se, duplicate messages will be handled like success messages, but message_id to still have _duplicate added to it.
Codecov Report
@@ Coverage Diff @@
## master #37 +/- ##
==========================================
+ Coverage 97.56% 97.60% +0.03%
==========================================
Files 11 11
Lines 576 584 +8
==========================================
+ Hits 562 570 +8
Misses 14 14
Continue to review full report at Codecov.
|
I think we need to remove the unique together for message_id and partner. If not when there is a failed message and then its retries it would cause integrity error i think, can you also add this to the test case. |
That can be removed, but should we then also remove the "_duplicate" from the message id on receiving duplicates? This currently prevents the integrity error for the first retry. |
Any changes requested for this PR?
|
So I guess I was wrong and it wont fail because I am doing an update or create in |
Function to identify for earlier duplicate changed to check for status "S" or "P".
Adding new setting ERROR_ON_DUPLICATE with default value True to preserve how application behaves now. If False, duplicate messages will be handled like success messages, but message_id to still have _duplicate added to it.
Currently, if no error is created for duplicate, the content of the message is stored once more. So if this should not happen, then various options should be checked:
pyas2lib would have to be adjusted to "continue on duplicate" and let django-pyas2 decide what it wants to do with a duplicate message - maybe by adding another status "D" that could then be used to decide if file should be stored or not.
Or have pyas2lib receive options what to do on duplicate.