From 7bd5b42f9e98e82719b13d79c118a88c473d4d77 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 19 Mar 2022 14:26:28 -0400 Subject: [PATCH] Ensure we lower case the fqsn received from all backends before delivery --- piker/data/feed.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/piker/data/feed.py b/piker/data/feed.py index 93989a58..408e7ea0 100644 --- a/piker/data/feed.py +++ b/piker/data/feed.py @@ -301,8 +301,11 @@ async def allocate_persistent_feed( loglevel=loglevel, ) ) - # the broker-specific fully qualified symbol name - bfqsn = init_msg[symbol]['fqsn'] + # the broker-specific fully qualified symbol name, + # but ensure it is lower-cased for external use. + bfqsn = init_msg[symbol]['fqsn'].lower() + init_msg[symbol]['fqsn'] = bfqsn + # HISTORY, run 2 tasks: # - a history loader / maintainer @@ -330,7 +333,6 @@ async def allocate_persistent_feed( # true fqsn fqsn = '.'.join((bfqsn, brokername)) - # add a fqsn entry that includes the ``.`` suffix init_msg[fqsn] = msg @@ -444,7 +446,7 @@ async def open_feed_bus( init_msg, first_quotes = bus.feeds[symbol] msg = init_msg[symbol] - bfqsn = msg['fqsn'] + bfqsn = msg['fqsn'].lower() # true fqsn fqsn = '.'.join([bfqsn, brokername]) @@ -763,7 +765,10 @@ async def maybe_open_feed( **kwargs, -) -> (Feed, ReceiveChannel[dict[str, Any]]): +) -> ( + Feed, + ReceiveChannel[dict[str, Any]], +): ''' Maybe open a data to a ``brokerd`` daemon only if there is no local one for the broker-symbol pair, if one is cached use it wrapped @@ -784,6 +789,7 @@ async def maybe_open_feed( 'start_stream': kwargs.get('start_stream', True), }, key=fqsn, + ) as (cache_hit, feed): if cache_hit: