Closed (fixed)
Project:
Simplenews
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2019 at 13:11 UTC
Updated:
6 Mar 2019 at 15:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
adamps commentedIt's all very baffling - layer upon layer of nested callbacks! Here is a patch that seems to solve it, but no idea what else it might break.
Comment #4
adamps commentedThe test failures are just the same as in the base branch, so effectively this has passed the tests.
Here is some further explanation. There are three submit handlers, called in the following order:
'::submitForm''::save': creates the subscriber entity.'::submitUpdate': writes the subscription records.With the checked-in code,
submitFormcallssubmitUpdate, which writes the subscription records, auto-creating the subscription entity. Then step 2savecreates another entity.Comment #5
adamps commented@Berdir please can you take a look when you have a moment. Only a one line fix, but it's very subtle so I don't want to commit without expert confirmation.
I just requeued the tests.
Comment #6
berdirYeah, definitely a bug, ugly. Test coverage should be fairly easy, we should have existing coverage for that form, so we "just" need to make sure that there's only one subscriber after that.
Wondering about existing data, should have an an update function that ensures there's only one subscriber per e-mail? Quite likely our entity should have a unique constraint on the e-mail, which might not have prevented this bug though.
Comment #7
adamps commentedThanks @Berdir.
Yes I have already been thinking about follow-on actions to fix the duplicates and prevent future ones - see #2937251: Prevent duplicate subscribers.
I propose that we should prioritise fixing this issue for now as it's a one-line change and at least stops making the problem worse. I will add a test as you suggest.
The other issue is more complex with schema changes and update hooks so it will take more work.
Comment #8
adamps commentedComment #10
adamps commented@Berdir tests done
I propose that I tag all issues that I plan to commit after waiting 7 days like this "Plan to commit". It should make it easy for you to find/check them. If you want to indicate that you have checked it, then you could remove the tag and set to RTBC in which case I don't need to wait.
Comment #11
adamps commented