Compare commits

..
Author SHA1 Message Date
Trenton H 80c3b6490c Fix: Add socket timeout options for broker and celery during status API 2026-11-18 20:50:47 -08:00
shamoon 14252054a1 Fix/tweak: update form inputs while typing (#14821) 2026-11-18 16:28:02 -08:00
github-actions[bot]andshamoon bcfdfcaa29 Documentation: Add v3.5.1 changelog (#14814)
* Changelog v3.5.1 - GHA

* Modify changelog for paperless-ngx version 3.5.1

Updated changelog to reflect changes in version 3.5.1.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
2026-11-17 21:52:43 -08:00
8 changed files with 146 additions and 17 deletions

No files matched your search

+24
View File
@@ -1,5 +1,29 @@
# Changelog
## paperless-ngx 3.5.1
### Changes
- Tweak: adjust chat timing for streaming [@shamoon](https://github.com/shamoon) ([#14805](https://github.com/paperless-ngx/paperless-ngx/pull/14805))
### Bug Fixes
- Fix: dont use set\_actor if audit log disabled in tasks [@shamoon](https://github.com/shamoon) ([#14808](https://github.com/paperless-ngx/paperless-ngx/pull/14808))
- Fix: stream AI chat answers under ASGI [@stumpylog](https://github.com/stumpylog) ([#14803](https://github.com/paperless-ngx/paperless-ngx/pull/14803))
- Tweak/fix: retain bulk edit selection after queuing operation [@shamoon](https://github.com/shamoon) ([#14797](https://github.com/paperless-ngx/paperless-ngx/pull/14797))
### All App Changes
<details>
<summary>4 changes</summary>
- Fix: dont use set\_actor if audit log disabled in tasks [@shamoon](https://github.com/shamoon) ([#14808](https://github.com/paperless-ngx/paperless-ngx/pull/14808))
- Tweak: adjust chat timing for streaming [@shamoon](https://github.com/shamoon) ([#14805](https://github.com/paperless-ngx/paperless-ngx/pull/14805))
- Fix: stream AI chat answers under ASGI [@stumpylog](https://github.com/stumpylog) ([#14803](https://github.com/paperless-ngx/paperless-ngx/pull/14803))
- Tweak/fix: retain bulk edit selection after queuing operation [@shamoon](https://github.com/shamoon) ([#14797](https://github.com/paperless-ngx/paperless-ngx/pull/14797))
</details>
## paperless-ngx 3.5.0
### Features / Enhancements
@@ -0,0 +1,90 @@
import { provideHttpClient } from '@angular/common/http'
import { provideHttpClientTesting } from '@angular/common/http/testing'
import { Component } from '@angular/core'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { FormControl, ReactiveFormsModule } from '@angular/forms'
import { NumberComponent } from './number/number.component'
import { TextComponent } from './text/text.component'
import { TextAreaComponent } from './textarea/textarea.component'
import { UrlComponent } from './url/url.component'
@Component({
imports: [
ReactiveFormsModule,
TextComponent,
NumberComponent,
TextAreaComponent,
UrlComponent,
],
template: `
<pngx-input-text [formControl]="control" />
<pngx-input-number [formControl]="control" [showAdd]="false" />
<pngx-input-textarea [formControl]="control" />
<pngx-input-url [formControl]="control" />
`,
})
class InputEventsHostComponent {
control = new FormControl<string | number | null>(null)
}
describe.each([
['text', 'pngx-input-text input', 'Edited text', 'Edited text'],
['number', 'pngx-input-number input', '42', 42],
['textarea', 'pngx-input-textarea textarea', 'Edited\ntext', 'Edited\ntext'],
['url', 'pngx-input-url input', 'https://example.com', 'https://example.com'],
])(
'%s input events',
(_type, selector: string, text: string, value: string | number) => {
let fixture: ComponentFixture<InputEventsHostComponent>
let control: FormControl<string | number | null>
let input: HTMLInputElement | HTMLTextAreaElement
beforeEach(() => {
TestBed.configureTestingModule({
imports: [InputEventsHostComponent],
providers: [provideHttpClient(), provideHttpClientTesting()],
})
fixture = TestBed.createComponent(InputEventsHostComponent)
control = fixture.componentInstance.control
})
async function render() {
fixture.detectChanges()
await fixture.whenStable()
input = fixture.nativeElement.querySelector(selector)
}
it('updates the form while typing and marks it touched only on blur', async () => {
await render()
const changed = jest.fn()
control.valueChanges.subscribe(changed)
input.value = text
input.dispatchEvent(new Event('input'))
expect(control.value).toBe(value)
expect(control.dirty).toBe(true)
expect(control.touched).toBe(false)
input.dispatchEvent(new Event('change'))
input.dispatchEvent(new Event('blur'))
expect(control.touched).toBe(true)
expect(changed).toHaveBeenCalledTimes(1)
})
it('honors an explicit updateOn blur strategy', async () => {
control = new FormControl<string | number | null>(null, {
updateOn: 'blur',
})
fixture.componentInstance.control = control
await render()
input.value = text
input.dispatchEvent(new Event('input'))
expect(control.value).toBeNull()
expect(control.pristine).toBe(true)
input.dispatchEvent(new Event('blur'))
expect(control.value).toBe(value)
expect(control.dirty).toBe(true)
expect(control.touched).toBe(true)
})
}
)
@@ -12,7 +12,7 @@
</div>
<div class="position-relative" [class.col-md-9]="horizontal">
<div class="input-group" [class.is-invalid]="error">
<input #inputField type="number" class="form-control" [step]="step" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [class.is-invalid]="error" [disabled]="disabled">
<input #inputField type="number" class="form-control" [step]="step" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [class.is-invalid]="error" [disabled]="disabled">
@if (showAdd) {
<button class="btn btn-outline-secondary" type="button" id="button-addon1" (click)="nextAsn()" [disabled]="disabled">+1</button>
}
@@ -11,7 +11,7 @@
}
</div>
<div class="position-relative" [class.col-md-9]="horizontal">
<input #inputField type="text" class="form-control" [class.is-invalid]="error" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [disabled]="disabled" [autocomplete]="autocomplete" [placeholder]="placeholder">
<input #inputField type="text" class="form-control" [class.is-invalid]="error" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [disabled]="disabled" [autocomplete]="autocomplete" [placeholder]="placeholder">
@if (hint) {
<small class="form-text text-muted" [innerHTML]="hint"></small>
}
@@ -18,7 +18,8 @@
[class.font-monospace]="monospace"
[(ngModel)]="value"
[ngModelOptions]="{standalone: true}"
(change)="onChange(value)"
(ngModelChange)="onChange($event)"
(blur)="onTouched()"
[disabled]="disabled"
[placeholder]="placeholder"
rows="4">
@@ -10,7 +10,7 @@
</div>
<div [class.col-md-9]="horizontal">
<div class="input-group" [class.is-invalid]="error">
<input #inputField type="url" class="form-control" [class.is-invalid]="error" placeholder="https://" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (change)="onChange(value)" [disabled]="disabled">
<input #inputField type="url" class="form-control" [class.is-invalid]="error" placeholder="https://" [id]="inputId" [(ngModel)]="value" [ngModelOptions]="{standalone: true}" (ngModelChange)="onChange($event)" (blur)="onTouched()" [disabled]="disabled">
<a class="btn btn-outline-secondary rounded-end" title="Open link" i18n-title [href]="value" target="_blank">
<pngx-bs-icon width="1.2em" height="1.2em" name="box-arrow-up-right"></pngx-bs-icon>
</a>
@@ -390,14 +390,12 @@ describe('DocumentDetailComponent', () => {
expect(component.documentForm.get('title').value).toEqual('Foo Bar')
})
it('should update title before doc change if was not updated via debounce', () => {
it('should update the title form value without waiting for debounce or blur', () => {
jest.useFakeTimers()
initNormally()
component.titleInput.value = 'Foo Bar'
component.titleInput.inputField.nativeElement.dispatchEvent(
new Event('change')
)
jest.advanceTimersByTime(1000)
const input = component.titleInput.inputField.nativeElement
input.value = 'Foo Bar'
input.dispatchEvent(new Event('input'))
expect(component.documentForm.get('title').value).toEqual('Foo Bar')
})
+23 -7
View File
@@ -5318,6 +5318,8 @@ class CustomFieldViewSet(PermissionsAwareDocumentCountMixin, ModelViewSet[Custom
class SystemStatusView(PassUserMixin):
permission_classes = (IsAuthenticated,)
TASK_SUMMARY_DAYS = 30
# Seconds to wait on the broker before reporting it as unreachable
BROKER_SOCKET_TIMEOUT = 5
def get(self, request, format=None):
if not has_system_status_permission(request.user):
@@ -5363,7 +5365,11 @@ class SystemStatusView(PassUserMixin):
if redis_url_parsed.hostname is not None:
redis_constructed_url += f":{redis_url_parsed.port}"
redis_error = None
with Redis.from_url(url=redis_url) as client:
with Redis.from_url(
url=redis_url,
socket_timeout=self.BROKER_SOCKET_TIMEOUT,
socket_connect_timeout=self.BROKER_SOCKET_TIMEOUT,
) as client:
try:
client.ping()
redis_status = "OK"
@@ -5378,12 +5384,22 @@ class SystemStatusView(PassUserMixin):
celery_url = None
try:
celery_ping = None
for ping_attempt in range(3):
celery_ping = celery_app.control.inspect().ping()
if celery_ping:
break
if ping_attempt < 2:
sleep(0.25)
# Use a dedicated connection with socket timeouts. Without them a
# stalled broker blocks this request (and its DB connection) forever
with celery_app.connection_for_read(
transport_options={
"socket_timeout": self.BROKER_SOCKET_TIMEOUT,
"socket_connect_timeout": self.BROKER_SOCKET_TIMEOUT,
},
) as celery_connection:
for ping_attempt in range(3):
celery_ping = celery_app.control.inspect(
connection=celery_connection,
).ping()
if celery_ping:
break
if ping_attempt < 2:
sleep(0.25)
if not celery_ping:
celery_active = "WARNING"