Skip to content

Commit

Permalink
Merge pull request #23 from OpenVoiceOS/dev
Browse files Browse the repository at this point in the history
0.0.4
  • Loading branch information
NeonDaniel authored Jan 10, 2024
2 parents 6c15675 + 34f8574 commit a23beba
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ dist

# Created by unit tests
.pytest_cache/
/.gtm/
65 changes: 53 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,74 @@
# Changelog

## [0.0.3](https://github.com/OpenVoiceOS/ovos-messagebus/tree/0.0.3) (2023-05-24)
## [V0.0.4a8](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.4a8) (2023-12-30)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.3a2...0.0.3)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.4a7...V0.0.4a8)

**Fixed bugs:**

- fix/log\_spam [\#22](https://github.com/OpenVoiceOS/ovos-messagebus/pull/22) ([JarbasAl](https://github.com/JarbasAl))

## [V0.0.4a7](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.4a7) (2023-12-29)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.4a6...V0.0.4a7)

**Merged pull requests:**

- Replace docker container actions [\#10](https://github.com/OpenVoiceOS/ovos-messagebus/pull/10) ([NeonDaniel](https://github.com/NeonDaniel))
- packaging/update\_imports [\#21](https://github.com/OpenVoiceOS/ovos-messagebus/pull/21) ([JarbasAl](https://github.com/JarbasAl))

## [V0.0.4a6](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.4a6) (2023-12-29)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.4a5...V0.0.4a6)

## [V0.0.3a2](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.3a2) (2023-05-24)
**Closed issues:**

- This happens when I ctrl+c a skill launched by ovos-skill-launcher [\#14](https://github.com/OpenVoiceOS/ovos-messagebus/issues/14)

**Merged pull requests:**

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.3a1...V0.0.3a2)
- Update requirements.txt [\#20](https://github.com/OpenVoiceOS/ovos-messagebus/pull/20) ([JarbasAl](https://github.com/JarbasAl))

## [V0.0.4a5](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.4a5) (2023-10-17)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.4a4...V0.0.4a5)

**Fixed bugs:**

- Killed if previous bus.pid exists [\#4](https://github.com/OpenVoiceOS/ovos-messagebus/issues/4)
- log tweaks [\#19](https://github.com/OpenVoiceOS/ovos-messagebus/pull/19) ([JarbasAl](https://github.com/JarbasAl))

**Closed issues:**
## [V0.0.4a4](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.4a4) (2023-09-28)

- Error when running [\#7](https://github.com/OpenVoiceOS/ovos-messagebus/issues/7)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.4a3...V0.0.4a4)

**Merged pull requests:**

- Update GitHub automation [\#9](https://github.com/OpenVoiceOS/ovos-messagebus/pull/9) ([NeonDaniel](https://github.com/NeonDaniel))
- Update dependencies to stable versions [\#8](https://github.com/OpenVoiceOS/ovos-messagebus/pull/8) ([NeonDaniel](https://github.com/NeonDaniel))
- \[requirements\] Add missing ovos-bus-client [\#18](https://github.com/OpenVoiceOS/ovos-messagebus/pull/18) ([goldyfruit](https://github.com/goldyfruit))

## [V0.0.3a1](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.3a1) (2023-04-30)
## [V0.0.4a3](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.4a3) (2023-09-27)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.2...V0.0.3a1)
[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.4a2...V0.0.4a3)

## [V0.0.4a2](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.4a2) (2023-08-16)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.4a1...V0.0.4a2)

**Closed issues:**

- Consider making this configurable with a default value. maybe `Configuration["logs"]["excluded_messages"]`? [\#16](https://github.com/OpenVoiceOS/ovos-messagebus/issues/16)

## [V0.0.4a1](https://github.com/OpenVoiceOS/ovos-messagebus/tree/V0.0.4a1) (2023-06-23)

[Full Changelog](https://github.com/OpenVoiceOS/ovos-messagebus/compare/V0.0.3...V0.0.4a1)

**Fixed bugs:**

- AttributeError: 'MemoryTempfile' object has no attribute 'tempdir' [\#12](https://github.com/OpenVoiceOS/ovos-messagebus/issues/12)
- Killed if previous bus.pid exists [\#4](https://github.com/OpenVoiceOS/ovos-messagebus/issues/4)

**Merged pull requests:**

- Remove PIDLock to fix \#4 [\#13](https://github.com/OpenVoiceOS/ovos-messagebus/pull/13) ([goldyfruit](https://github.com/goldyfruit))
- Replace docker container actions [\#10](https://github.com/OpenVoiceOS/ovos-messagebus/pull/10) ([NeonDaniel](https://github.com/NeonDaniel))



Expand Down
4 changes: 1 addition & 3 deletions ovos_messagebus/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from ovos_utils import create_daemon, wait_for_exit_signal
from ovos_messagebus.load_config import load_message_bus_config
from ovos_utils.log import LOG, init_service_logger
from ovos_utils.process_utils import reset_sigint_handler, PIDLock
from ovos_utils.process_utils import reset_sigint_handler
from tornado import web, ioloop

from ovos_messagebus.event_handler import MessageBusEventHandler
Expand All @@ -41,10 +41,8 @@ def on_stopping():


def main(ready_hook=on_ready, error_hook=on_error, stopping_hook=on_stopping):
PIDLock.init()
reset_sigint_handler()
init_service_logger("bus")
PIDLock("bus")
LOG.info('Starting message bus service...')
config = load_message_bus_config()
routes = [(config.route, MessageBusEventHandler)]
Expand Down
20 changes: 17 additions & 3 deletions ovos_messagebus/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
import sys
import traceback

from ovos_utils.messagebus import FakeMessage as Message
from ovos_utils.fakebus import Message
from ovos_utils.log import LOG
from ovos_config import Configuration
from pyee import EventEmitter
from tornado.websocket import WebSocketHandler
from ovos_bus_client.session import SessionManager

client_connections = []

Expand All @@ -33,13 +35,24 @@ def __init__(self, application, request, **kwargs):
def on(self, event_name, handler):
self.emitter.on(event_name, handler)

@property
def max_message_size(self) -> int:
return Configuration().get("websocket", {}).get("max_msg_size", 10) * 1024 * 1024

def on_message(self, message):
LOG.debug(message)

try:
deserialized_message = Message.deserialize(message)
except Exception:
return

filter_ogs = ["gui.status.request", "gui.page.upload"]
if deserialized_message.msg_type not in filter_ogs:
LOG.debug(deserialized_message.msg_type +
f' source: {deserialized_message.context.get("source", [])}' +
f' destination: {deserialized_message.context.get("destination", [])}\n'
f'SESSION: {SessionManager.get(deserialized_message).serialize()}')

try:
self.emitter.emit(deserialized_message.msg_type,
deserialized_message)
Expand All @@ -52,7 +65,8 @@ def on_message(self, message):
client.write_message(message)

def open(self):
self.write_message(Message("connected").serialize())
self.write_message(Message("connected",
context={"session": {"session_id": "default"}}).serialize())
client_connections.append(self)

def on_close(self):
Expand Down
2 changes: 1 addition & 1 deletion ovos_messagebus/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 0
VERSION_BUILD = 3
VERSION_BUILD = 4
VERSION_ALPHA = 0
# END_VERSION_BLOCK
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
tornado~=6.0, >=6.0.3
ovos-utils~=0.0, >=0.0.32
ovos-config~=0.0,>=0.0.8
ovos-bus-client~=0.0, >=0.0.7
ovos-utils~=0.0, >=0.0.37
ovos-config~=0.0,>=0.0.12

0 comments on commit a23beba

Please sign in to comment.