Compare commits

...

2 Commits

Author SHA1 Message Date
daniel156161 d3e5e11f8d fix(cli): ignore generated folders in subfolders
Build and Push Docker Container / build-and-push (push) Successful in 3m12s
- Match directory ignore patterns against every path segment.
- Prevent nested .comments folders from uploading XML sidecar files.
- Bump the standalone CLI to 0.4.2 for the ignore fix.
2026-07-28 00:14:00 +02:00
daniel156161 08d0d154c9 fix(api): keep file event streams alive
Build and Push Docker Container / build-and-push (push) Successful in 2m7s
- Disable the Quart response timeout for authenticated file event streams.
- Send SSE keepalives more often to avoid idle proxy disconnects.
- Treat remote stream interruptions as reconnectable disconnects in watch output.
- Bump NanoShare to 1.26.0 and the standalone CLI to 0.4.1.
2026-07-27 22:51:03 +02:00
7 changed files with 13 additions and 6 deletions
+2
View File
@@ -46,6 +46,8 @@ def is_ignored(rel_path: str, patterns: list[str]) -> bool:
if pattern.endswith('/'):
if path == normalized or path.startswith(f'{normalized}/'):
return True
if any(fnmatch(part, normalized) for part in parts):
return True
continue
if '/' in normalized:
if fnmatch(path, normalized):
+1 -1
View File
@@ -55,7 +55,7 @@ def _remote_events_thread(args, flag: _ChangeFlag, stop: threading.Event) -> thr
flag.notify()
except Exception as exc:
if not stop.is_set():
print(f'remote event stream unavailable; retrying in 30s: {exc}', file=sys.stderr)
print(f'remote event stream disconnected; retrying in 30s: {exc}', file=sys.stderr)
stop.wait(30)
finally:
if client:
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "nanoshare-cli"
version = "0.4.0"
version = "0.4.2"
description = "NanoShare desktop CLI and folder sync client"
readme = "README.md"
requires-python = ">=3.11"
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "nanoshare"
version = "1.25.0"
version = "1.26.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"
+4 -2
View File
@@ -37,7 +37,7 @@ async def api_file_events(user: dict):
previous = await _snapshot(user_id)
yield 'event: ready\ndata: {}\n\n'
while True:
await asyncio.sleep(30)
await asyncio.sleep(15)
current = await _snapshot(user_id)
if current != previous:
previous = current
@@ -45,7 +45,9 @@ async def api_file_events(user: dict):
else:
yield ': keepalive\n\n'
return Response(stream(), content_type='text/event-stream', headers={
response = Response(stream(), content_type='text/event-stream', headers={
'Cache-Control': 'no-cache',
'X-Accel-Buffering': 'no',
})
response.timeout = None
return response
+3
View File
@@ -213,6 +213,8 @@ def test_sync_ignores_local_files_from_nanoshareignore(tmp_path, monkeypatch):
(tmp_path / 'scratch.tmp').write_text('ignored')
(tmp_path / '.comments').mkdir()
(tmp_path / '.comments' / 'ignored.xml').write_text('<comment />')
(tmp_path / 'Cerberus' / '.comments').mkdir(parents=True)
(tmp_path / 'Cerberus' / '.comments' / '76. Two-headeds.PNG.xml').write_text('<comment />')
(tmp_path / '.env').write_text('SECRET=ignored')
(tmp_path / '.venv').mkdir()
(tmp_path / '.venv' / 'ignored.py').write_text('ignored')
@@ -261,6 +263,7 @@ def test_default_ignore_patterns_skip_common_generated_files(tmp_path):
patterns = load_ignore_patterns(tmp_path)
assert is_ignored('.comments/comment.xml', patterns)
assert is_ignored('Cerberus/.comments/76. Two-headeds.PNG.xml', patterns)
assert is_ignored('.env', patterns)
assert is_ignored('.env.local', patterns)
assert is_ignored('.venv/bin/python', patterns)
Generated
+1 -1
View File
@@ -720,7 +720,7 @@ wheels = [
[[package]]
name = "nanoshare"
version = "1.25.0"
version = "1.26.0"
source = { virtual = "." }
dependencies = [
{ name = "aiohttp" },