Skip to content

Commit 6156371

Browse files
authored
Merge branch 'unstable' into fix/guild-chunch_cache
2 parents 3034e92 + 0ac5fa3 commit 6156371

File tree

11 files changed

+248
-29
lines changed

11 files changed

+248
-29
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 2
22
updates:
33
- package-ecosystem: "github-actions" # See documentation for possible values
4+
target-branch: "unstable"
45
directory: "/" # Location of package manifests
56
schedule:
67
interval: "weekly"

.github/workflows/docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ jobs:
1919
key: ${{ github.ref }}
2020
path: .cache
2121
- run: pip install -e .[docs]
22-
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
2322
- run: mkdocs gh-deploy
2423
env:
2524
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/pytest-push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
include:
1919
- extras: .[all]
2020
python-version: "3.10"
21-
RUN_TESTBOT: true
21+
#RUN_TESTBOT: true
2222
- extras: .[all]
2323
python-version: "3.11"
24-
RUN_TESTBOT: true
24+
#RUN_TESTBOT: true
2525

2626
steps:
2727
- uses: actions/checkout@v4

interactions/api/gateway/gateway.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ async def run(self) -> None:
158158
seq = msg.get("s")
159159
event = msg.get("t")
160160

161+
if op == MISSING:
162+
# Internal no-op, ignore it.
163+
continue
164+
161165
if seq:
162166
self.sequence = seq
163167

interactions/api/gateway/websocket.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ async def send_json(self, data: dict, bypass=False) -> None:
164164
serialized = FastJson.dumps(data)
165165
await self.send(serialized, bypass)
166166

167-
async def receive(self, force: bool = False) -> str: # noqa: C901
167+
async def receive(self, force: bool = False) -> dict: # noqa: C901
168168
"""
169169
Receive a full event payload from the WebSocket.
170170
@@ -208,6 +208,14 @@ async def receive(self, force: bool = False) -> str: # noqa: C901
208208
# is possible after all we can just wait for the event to be set.
209209
await self._closed.wait()
210210
else:
211+
if self.state.client.http.closed:
212+
# On aiohttp>=3.12.4, the aiohttp WebSocket client will always send a session
213+
# close message when the underlying HTTP connection is closed. We want to
214+
# ignore this to keep the behavior consistent with previous versions
215+
# of Python, so we return this to indicate that no message was received.
216+
# https://github.com/interactions-py/interactions.py/issues/1778
217+
return {"op": const.MISSING}
218+
211219
# This is an odd corner-case where the underlying socket connection was closed
212220
# unexpectedly without communicating the WebSocket closing handshake. We'll have
213221
# to reconnect ourselves.

interactions/api/http/http_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,17 @@ def __init__(
250250
logger = constants.get_logger()
251251
self.logger = logger
252252

253+
@property
254+
def closed(self) -> bool:
255+
"""
256+
Returns whether the session is closed.
257+
258+
Returns:
259+
True if the session is closed, False otherwise.
260+
261+
"""
262+
return self.__session is None or self.__session.closed
263+
253264
def get_ratelimit(self, route: Route) -> BucketLock:
254265
"""
255266
Get a route's rate limit bucket.

interactions/ext/hybrid_commands/hybrid_slash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def __init__(
134134

135135
async def convert(self, ctx: BaseContext, argument: str) -> float | int:
136136
try:
137-
converted: float | int = await maybe_coroutine(self.number_convert, ctx, argument)
137+
converted: float | int = await maybe_coroutine(self.number_convert, argument)
138138

139139
if self.min_value and converted < self.min_value:
140140
raise BadArgument(f'Value "{argument}" is less than {self.min_value}.')

0 commit comments

Comments
 (0)