[JBoss JIRA] (CDI-746) PBA should be fired just after PAT and not after PIP or PIT
by Romain Manni-Bucau (Jira)
[ https://issues.redhat.com/browse/CDI-746?page=com.atlassian.jira.plugin.s... ]
Romain Manni-Bucau commented on CDI-746:
----------------------------------------
[~manovotn] I agree both cases "can" exist but since I never saw one of both I priviledge the other (once again, if you have some examples of this being wrong I could revise my position and try to find another solution).
Issue I have is more when the extension adds things cause it collected data to do so but then (after the collect) the bean is veto so the extension still do something (adds a new bean) whereas it shouldn't do anything and modify the bean set of the CDI context. Think to MP-Config, a way to impl it is to capture all ConfigProperty injections and add a bean for all these types. If in between a bean containing some of these injections is veto (and it was the only one with these types) then the extension will wrongly add these types/beans. Same with alternative regard (which can only be resolved after PBA) if not done early. In some cases the impact is only memory, in some other, the runtime is just wrong (if types are used for runtime, it is typically the case).
> PBA should be fired just after PAT and not after PIP or PIT
> -----------------------------------------------------------
>
> Key: CDI-746
> URL: https://issues.redhat.com/browse/CDI-746
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Portable Extensions
> Affects Versions: 2.0.SP1
> Reporter: Romain Manni-Bucau
> Priority: Major
>
> Today spec put PBA after PIP and PIT which leads to have orphan events for PIP and PIT and thefore register wrong beans in portable extensions if PBA is veto.
> Luckily today PBA is not that used but we should ensure vetos happen before any other events to ease work for extension author (didn't see any extension checking the information captured are no more relevant today so this affects pretty much all extensions + it breaks extension and alternative support in most cases).
> Proposal is to move up the PBA event after PAT one enabling a straight forward extension API instead of a very complex one for meta capture today.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (CDI-746) PBA should be fired just after PAT and not after PIP or PIT
by Matěj Novotný (Jira)
[ https://issues.redhat.com/browse/CDI-746?page=com.atlassian.jira.plugin.s... ]
Matěj Novotný commented on CDI-746:
-----------------------------------
{quote} if a PBA is veto there is no injection point for it so it shouldn't be fired
{quote}
In accordance to current spec wording, PIP should be fired as it precedes PBA. So the injection point exists at the time you fire the event. The actual takeaway is that you should be aware of the ordering.
Ok, I see what you meant by orphaned.
So firstly, you are saying that (1) is broken - but you automatically consider that you perform (1) when you also perform (2) (which you yourself discarded as "never seen" in the first place). Those two use cases can exist on their own and work perfectly well.
Secondly, I don't see how (1) would be broken even if you performed both, (1) and (2) within single application. Say you monitor PIP to detect an injection of {{Foo}} and you know there is no such bean and want to register an additional bean of that type if you detect usage. Fine, you can still do that. The fact that. There is exactly "n" cases where {{Foo}} is injected, in this case n > 0. Then you have vetoing - you can decide to veto "m" types, where {{m <= n}}; in other words, legit injection points may remain even after some vetoing.
The only edge case would be if you {{m == n}} and you veto all occurrences. But even in such a case you end up registering {{Foo}} that just never gets created if it's not needed.
> PBA should be fired just after PAT and not after PIP or PIT
> -----------------------------------------------------------
>
> Key: CDI-746
> URL: https://issues.redhat.com/browse/CDI-746
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Portable Extensions
> Affects Versions: 2.0.SP1
> Reporter: Romain Manni-Bucau
> Priority: Major
>
> Today spec put PBA after PIP and PIT which leads to have orphan events for PIP and PIT and thefore register wrong beans in portable extensions if PBA is veto.
> Luckily today PBA is not that used but we should ensure vetos happen before any other events to ease work for extension author (didn't see any extension checking the information captured are no more relevant today so this affects pretty much all extensions + it breaks extension and alternative support in most cases).
> Proposal is to move up the PBA event after PAT one enabling a straight forward extension API instead of a very complex one for meta capture today.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (CDI-746) PBA should be fired just after PAT and not after PIP or PIT
by Romain Manni-Bucau (Jira)
[ https://issues.redhat.com/browse/CDI-746?page=com.atlassian.jira.plugin.s... ]
Romain Manni-Bucau commented on CDI-746:
----------------------------------------
[~manovotn] ok so there are two things to consider:
# PIP/PIT as collectors of meta to add beans
# PIP/PIT as "evaluator for vetoing"
(1) is broken by such a rule, (2) is enabled by this rule.
However, I didn't see a single extension doing 2 but I saw several doing 1 without the safeness of validating it had been veto or not since it is way too much complex so I think this should be changed by the practise. Do you have some counter examples - hopefully public?
Side note: they are orphan in (1) and lead to a wrong extension impl whereas PIP should be usable to collect injections, or rephrased: if a PBA is veto there is no injection point for it so it shouldn't be fired ;).
> PBA should be fired just after PAT and not after PIP or PIT
> -----------------------------------------------------------
>
> Key: CDI-746
> URL: https://issues.redhat.com/browse/CDI-746
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Portable Extensions
> Affects Versions: 2.0.SP1
> Reporter: Romain Manni-Bucau
> Priority: Major
>
> Today spec put PBA after PIP and PIT which leads to have orphan events for PIP and PIT and thefore register wrong beans in portable extensions if PBA is veto.
> Luckily today PBA is not that used but we should ensure vetos happen before any other events to ease work for extension author (didn't see any extension checking the information captured are no more relevant today so this affects pretty much all extensions + it breaks extension and alternative support in most cases).
> Proposal is to move up the PBA event after PAT one enabling a straight forward extension API instead of a very complex one for meta capture today.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (CDI-746) PBA should be fired just after PAT and not after PIP or PIT
by Matěj Novotný (Jira)
[ https://issues.redhat.com/browse/CDI-746?page=com.atlassian.jira.plugin.s... ]
Matěj Novotný commented on CDI-746:
-----------------------------------
To provide full background, there is CDITCK-590 and the discussion in it.
And there is a CDI TCK test asserting current ordering, see [this|https://github.com/eclipse-ee4j/cdi-tck/blob/master/impl/src/main/ja...]. This change would break backwards compatibility.
Personally, I am -1 on changing this. I don't see much use in having two follow-up events that both offer veto option when nothing really changes in between. OTOH if you leave it as it is, it allows you or other extensions to change things around in PIP and PIT and after that you can decide in PBA (based on updated state perhaps) whether you want to veto it or not. Therefore, I don't see those events as "orphaned".
> PBA should be fired just after PAT and not after PIP or PIT
> -----------------------------------------------------------
>
> Key: CDI-746
> URL: https://issues.redhat.com/browse/CDI-746
> Project: CDI Specification Issues
> Issue Type: Bug
> Components: Portable Extensions
> Affects Versions: 2.0.SP1
> Reporter: Romain Manni-Bucau
> Priority: Major
>
> Today spec put PBA after PIP and PIT which leads to have orphan events for PIP and PIT and thefore register wrong beans in portable extensions if PBA is veto.
> Luckily today PBA is not that used but we should ensure vetos happen before any other events to ease work for extension author (didn't see any extension checking the information captured are no more relevant today so this affects pretty much all extensions + it breaks extension and alternative support in most cases).
> Proposal is to move up the PBA event after PAT one enabling a straight forward extension API instead of a very complex one for meta capture today.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (CDI-746) PBA should be fired just after PAT and not after PIP or PIT
by Romain Manni-Bucau (Jira)
Romain Manni-Bucau created CDI-746:
--------------------------------------
Summary: PBA should be fired just after PAT and not after PIP or PIT
Key: CDI-746
URL: https://issues.redhat.com/browse/CDI-746
Project: CDI Specification Issues
Issue Type: Bug
Components: Portable Extensions
Affects Versions: 2.0.SP1
Reporter: Romain Manni-Bucau
Today spec put PBA after PIP and PIT which leads to have orphan events for PIP and PIT and thefore register wrong beans in portable extensions if PBA is veto.
Luckily today PBA is not that used but we should ensure vetos happen before any other events to ease work for extension author (didn't see any extension checking the information captured are no more relevant today so this affects pretty much all extensions + it breaks extension and alternative support in most cases).
Proposal is to move up the PBA event after PAT one enabling a straight forward extension API instead of a very complex one for meta capture today.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months