I have found an issue with the solution applied in
MYFACES-3663. The steps to cause the problem are the following:
1. The view is rendered and some unique ids are generated. UIViewRoot has state and it is saved.
2. The view needs to be restored, PSS algorithm takes the uniqueIdCounter from the state and set it to UIViewRoot, then the initial state is constructed using facelets algorithm
3. Inside facelets algorithm, a new component is created and that increase uniqueIdCounter (f:ajax tag handler adds default jsf.js and ask for a unique id from UIViewRoot).
4. The delta state is applied, overriding uniqueIdCounter.
5. A new component is created in render response phase, creating the duplicate id condition.
6. The state saving algorithm detects the duplicate id and throw duplicate id exception.
The conditions required to reproduce the problem are very unlikely, so other tests done were not able to reproduce the problem.