Skip to content

Commit b803cb5

Browse files
authored
feat: use new AppAPI endpoint for ExApp status report (#414)
Fix for some flaky situations where ExApp can fail to update it's status during install/update in AppAPI will be only for the new endpoint: nextcloud/app_api#807 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Changed** * App initialization status reporting now uses a new standardized endpoint for reporting progress and errors. * **Chores** * Package version updated to 0.24.2.dev0. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent d6ca6b3 commit b803cb5

4 files changed

Lines changed: 13 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.24.2 - 2026-03-02]
6+
7+
### Changed
8+
9+
- Use new `/ex-app/status` endpoint for `set_init_status` instead of deprecated `/apps/status/{appId}`
10+
511
## [0.24.1 - 2026-02-25]
612

713
### Fixed

nc_py_api/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Version of nc_py_api."""
22

3-
__version__ = "0.24.1"
3+
__version__ = "0.24.2.dev0"

nc_py_api/nextcloud.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def set_init_status(self, progress: int, error: str = "") -> None:
432432
"""
433433
self._session.ocs(
434434
"PUT",
435-
f"/ocs/v1.php/apps/app_api/apps/status/{self._session.cfg.app_name}",
435+
"/ocs/v1.php/apps/app_api/ex-app/status",
436436
json={
437437
"progress": progress,
438438
"error": error,
@@ -566,7 +566,7 @@ async def set_init_status(self, progress: int, error: str = "") -> None:
566566
"""
567567
await self._session.ocs(
568568
"PUT",
569-
f"/ocs/v1.php/apps/app_api/apps/status/{self._session.cfg.app_name}",
569+
"/ocs/v1.php/apps/app_api/ex-app/status",
570570
json={
571571
"progress": progress,
572572
"error": error,

tests/actual_tests/files_sharing_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def test_create_expire_time(nc):
205205
expire_time = expire_time.replace(hour=0, minute=0, second=0, microsecond=0)
206206
new_share = nc.files.sharing.create("test_12345_text.txt", ShareType.TYPE_LINK, expire_date=expire_time)
207207
nc.files.sharing.delete(new_share)
208-
assert new_share.expire_date == expire_time
208+
assert new_share.expire_date.date() == expire_time.date()
209209
with pytest.raises(NextcloudException):
210210
nc.files.sharing.create(
211211
"test_12345_text.txt", ShareType.TYPE_LINK, expire_date=datetime.datetime.now() - datetime.timedelta(days=1)
@@ -221,7 +221,7 @@ async def test_create_expire_time_async(anc):
221221
expire_time = expire_time.replace(hour=0, minute=0, second=0, microsecond=0)
222222
new_share = await anc.files.sharing.create("test_12345_text.txt", ShareType.TYPE_LINK, expire_date=expire_time)
223223
await anc.files.sharing.delete(new_share)
224-
assert new_share.expire_date == expire_time
224+
assert new_share.expire_date.date() == expire_time.date()
225225
with pytest.raises(NextcloudException):
226226
await anc.files.sharing.create(
227227
"test_12345_text.txt", ShareType.TYPE_LINK, expire_date=datetime.datetime.now() - datetime.timedelta(days=1)
@@ -295,7 +295,7 @@ def test_create_update(nc):
295295
expire_time = datetime.datetime.now() + datetime.timedelta(days=1)
296296
expire_time = expire_time.replace(hour=0, minute=0, second=0, microsecond=0)
297297
update_share = nc.files.sharing.update(new_share, expire_date=expire_time)
298-
assert update_share.expire_date == expire_time
298+
assert update_share.expire_date.date() == expire_time.date()
299299
update_share = nc.files.sharing.update(new_share, note="note", label="label")
300300
assert update_share.note == "note"
301301
assert update_share.label == "label"
@@ -328,7 +328,7 @@ async def test_create_update_async(anc):
328328
expire_time = datetime.datetime.now() + datetime.timedelta(days=1)
329329
expire_time = expire_time.replace(hour=0, minute=0, second=0, microsecond=0)
330330
update_share = await anc.files.sharing.update(new_share, expire_date=expire_time)
331-
assert update_share.expire_date == expire_time
331+
assert update_share.expire_date.date() == expire_time.date()
332332
update_share = await anc.files.sharing.update(new_share, note="note", label="label")
333333
assert update_share.note == "note"
334334
assert update_share.label == "label"

0 commit comments

Comments
 (0)