I am looking for a solution to a basic scenario:
A User in a Community submits an Opportunity, this Opportunity is enriched with data synchronously upon insert and asynchronously through integrations upon updates. An LWC is used to present the Opportunity to the User whom can take actions on this, update fields etc.
In a specific scenario the StageName will go from X -> Y based on response from a Platform Event integration (Async). In our ideal scenario the LWC would then auto-refresh its data and the field Stage Name would show Y.
Since it is in the Communities we cannot use the EMP Api and it appears that if you utilize the Record Edit Form it doesn't detect changes from Lightning Experience UI nor when the change occurs from an API or process update (towards the Communities), the same component updates correctly once added in Lightning Experience, but not in Communities.
Currently I have an ugly refresh javascript action with timeout that uses refreshApex, I am OK with using the refreshApex method, if I can just make sure that I know when to call it (when there is an actual change on the record).
If there is not a "real" solution for this until EMP Api is available in Communities, how are these use cases handled then (not necessarily best practice but more in theory)?
Basic example of the code used:
<lightning-record-edit-form record-id={recordId} object-api-name="Opportunity">
<lightning-input-field field-name="Name">
</lightning-input-field>
<lightning-input-field field-name="StageName">
</lightning-input-field>
<lightning-button
class="slds-m-top_small"
variant="brand"
type="submit"
name="update"
label="Update">
</lightning-button>
</lightning-record-edit-form>