MarketSquare / MarketSquare/Rammbock

Cannot use BinaryContainer field as header_filter in server_receives_message

Open
#18 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
64
Forks
48
PR merge metrics
No merged PRs in 30d

Description

I have a message that doesn't have message fields to it.
The message is a type of (ACK)acknowledgement to another message and it contains only header part of the protocol.
The protocol is our company's custom protocol and contains binary fields in the header
and the Binary Containers name is 'Flags'

How can I verify that the received message is my ACK message?

While doing the

```
'''
${msg} = Server Receives Message header_filter = Flags
'''
```

I get the following error

```
File "C:\Python27\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\Python27\lib\site-packages\Rammbock\core.py", line 503, in _receive
msg = node.get_message(self._get_message_template(), **configs)
File "C:\Python27\lib\site-packages\Rammbock\networking.py", line 73, in get_message
return self._get_from_stream(message_template, self._message_stream, timeout=timeout, header_filter=header_filter)
File "C:\Python27\lib\site-packages\Rammbock\networking.py", line 76, in _get_from_stream
return stream.get(message_template, timeout=timeout, header_filter=header_filter)
File "C:\Python27\lib\site-packages\Rammbock\templates\message_stream.py", line 35, in get
if self._matches(header, header_fields, header_filter):
File "C:\Python27\lib\site-packages\Rammbock\templates\message_stream.py", line 60, in _matches
if header[header_filter].bytes != to_bin(fields[header_filter]):
File "C:\Python27\lib\site-packages\Rammbock\message.py", line 38, in __getattr__
return self[name]
File "C:\Python27\lib\site-packages\Rammbock\message.py", line 35, in __getitem__
return self._fields[str(name)]
KeyError: 'bytes'
```

Can the Individual fields of the Binary container be used as header filters?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in rammbock/templates/message_stream.py at _matches and trace the header_filter path from networking.py; inspect rammbock/message.py to understand why the BinaryContainer lookup lacks bytes. Reproduce the ACK/header-filter case described in the issue, then verify that filtering on an individual Binary container field no longer raises KeyError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.