Skip to content

Commit 7412e95

Browse files
authored
fix 64 bit timestamps windows issue (#147)
1 parent 5073e8c commit 7412e95

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## 4.4.8 (unreleased)
44

55

6-
- Nothing changed yet.
6+
- Fix issue with 64 bit timestamp expirations on windows
77

88

99
## 4.4.7 (2025-01-22)

nuclia/lib/nua_chat.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ def _parse_token(token: str):
5454
b64_payload = parts[1]
5555
payload = json.loads(b64decode(b64_payload + "=="))
5656
regional_url = payload["iss"]
57-
expiration_date = datetime.fromtimestamp(payload["exp"], tz=timezone.utc)
57+
token_expire_ts = payload["exp"]
58+
if token_expire_ts >= 32536850400:
59+
# sc-11523
60+
token_expire_ts = 32536850399
61+
62+
expiration_date = datetime.fromtimestamp(token_expire_ts, tz=timezone.utc)
5863
return regional_url, expiration_date
5964

6065
def _process_messages(self, messages: list[dict[str, str]]) -> tuple[str, str]:

0 commit comments

Comments
 (0)