Closed anlambert closed 2 months ago
For the record, the issue can be fixed by reverting ea6f38cf4d82700a94cb67593119f5860a66effe.
But I got hit by another Python client issue after that revert:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
swh/webhooks/interface.py:629: in sent_events_list_for_endpoint
for attempt in islice(svix_list(list_attempted_messages_by_endpoint), limit):
swh/webhooks/interface.py:121: in svix_list
response = svix_list_request(iterator)
swh/webhooks/interface.py:616: in list_attempted_messages_by_endpoint
return self.svix_api.message_attempt.list_by_endpoint(
../../../dev/svix-webhooks/python/build/__editable__.svix-1.32.0-py3-none-any/svix/api.py:1261: in list_by_endpoint
return v1_message_attempt_list_by_endpoint.request_sync(
../../../dev/svix-webhooks/python/build/__editable__.svix-1.32.0-py3-none-any/svix/internal/openapi_client/api/message_attempt/v1_message_attempt_list_by_endpoint.py:303: in request_sync
return request_sync_detailed(
../../../dev/svix-webhooks/python/build/__editable__.svix-1.32.0-py3-none-any/svix/internal/openapi_client/api/message_attempt/v1_message_attempt_list_by_endpoint.py:234: in request_sync_detailed
return _build_response(client=client, response=response)
../../../dev/svix-webhooks/python/build/__editable__.svix-1.32.0-py3-none-any/svix/internal/openapi_client/api/message_attempt/v1_message_attempt_list_by_endpoint.py:130: in _build_response
parsed=_parse_response(client=client, response=response),
../../../dev/svix-webhooks/python/build/__editable__.svix-1.32.0-py3-none-any/svix/internal/openapi_client/api/message_attempt/v1_message_attempt_list_by_endpoint.py:105: in _parse_response
response_200 = ListResponseMessageAttemptOut.from_dict(response.json())
../../../dev/svix-webhooks/python/build/__editable__.svix-1.32.0-py3-none-any/svix/internal/openapi_client/models/list_response_message_attempt_out.py:64: in from_dict
data_item = MessageAttemptOut.from_dict(data_item_data)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <class 'svix.internal.openapi_client.models.message_attempt_out.MessageAttemptOut'>
src_dict = {'endpointId': 'ep_2lbKuaL4s5lW7oe39Ry3ipiAsMj', 'id': 'atmpt_2lbKucxSGDj6HqFLcSrJhmuJveo', 'msgId': 'msg_2lbKucvIIKDWf9qPyY0rUvfq352', 'response': 'OK', ...}
@classmethod
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
from ..models.message_out import MessageOut
d = src_dict.copy()
endpoint_id = d.pop("endpointId")
id = d.pop("id")
msg_id = d.pop("msgId")
response = d.pop("response")
> response_duration_ms = d.pop("responseDurationMs")
E KeyError: 'responseDurationMs'
../../../dev/svix-webhooks/python/build/__editable__.svix-1.32.0-py3-none-any/svix/internal/openapi_client/models/message_attempt_out.py:106: KeyError
This one can be fixed by reverting 52d1a88fb036f5f1daee0db8dcd0364270b38184.
It seems the OpenAPI specification is not synchronized with the rust implementation of the svix server.
Thanks for the report, we are checking!
Should be fixed with the two PRs linked above. The root openapi.json
is intentionally not the same as server/openapi.json
, as it includes extra endpoints only available in our cloud / enterprise offerings and not the OSS version of svix. Any differences that cause the clients to not work with supported endpoints of the OSS server are of course bugs, though.
We've got some other bugs to fix w.r.t. to the libraries, so it might take a couple of days until we release the fixes.
Since
svix v1.29.0
and up to current release, the following error is reported when attempting to create an event type using Python:To reproduce the issue, you can clone https://gitlab.softwareheritage.org/swh/devel/swh-webhooks/ repository and apply the following diff:
Then install
tox
in your Python environment withpip
and executetox
inswh-webhooks
directory (to be noted:docker compose
is required to run these tests).