Skip to content

Commit 588f094

Browse files
committed
Stop passing the filter from the source graph to a target graph during a traversal of an internal subscription graph link if the target graph expects no filter parameter. Otherwise, when a non-bulk subscription occurs, the filter is added to target and will not match the same graph when multiple graph links points at the same target graph and the client will crash with an error like: "Attempt to update channel 1.45.X but channel does not allow dynamic updates of filter and channel has not been explicitly subscribed.".
1 parent 590bf45 commit 588f094

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
### Unreleased
44

5+
* Stop passing the filter from the source graph to a target graph during a traversal of an internal subscription graph link if the target graph expects no filter parameter. Otherwise, when a non-bulk subscription occurs, the filter is added to target and will not match the same graph when multiple graph links points at the same target graph and the client will crash with an error like: "Attempt to update channel 1.45.X but channel does not allow dynamic updates of filter and channel has not been explicitly subscribed.".
6+
57
### [v6.127](https://github.com/replicant4j/replicant/tree/v6.127) (2022-10-03) · [Full Changelog](https://github.com/spritz/spritz/compare/v6.126...v6.127)
68

79
Changes in this release:

server/src/main/java/org/realityforge/replicant/server/transport/ReplicantSessionManagerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,13 +468,13 @@ ChannelLinkEntry createChannelLinkEntryIfRequired( @Nonnull final ReplicantSessi
468468
if ( null != sourceEntry )
469469
{
470470
final ChannelAddress target = link.getTargetChannel();
471-
if ( !getSystemMetaData().getChannelMetaData( target ).hasFilterParameter() ||
472-
shouldFollowLink( sourceEntry, target ) )
471+
final boolean targetHasFilter = getSystemMetaData().getChannelMetaData( target ).hasFilterParameter();
472+
if ( !targetHasFilter || shouldFollowLink( sourceEntry, target ) )
473473
{
474474
final SubscriptionEntry targetEntry = session.findSubscriptionEntry( target );
475475
if ( null == targetEntry )
476476
{
477-
return new ChannelLinkEntry( source, link.getTargetChannel(), sourceEntry.getFilter() );
477+
return new ChannelLinkEntry( source, link.getTargetChannel(), targetHasFilter ? sourceEntry.getFilter() : null );
478478
}
479479
else
480480
{

0 commit comments

Comments
 (0)