Skip to content

PERF: JMAP batch operations execute sequentially instead of using native batching #915

@andrinoff

Description

@andrinoff

Is your feature request related to a problem?

In backend/jmap/jmap.go (lines 369-396), batch operations (DeleteEmails, ArchiveEmails, MoveEmails) loop through UIDs one-by-one:

for _, uid := range uids {
    if err := p.DeleteEmail(ctx, folder, uid); err != nil {
        return err
    }
}

JMAP supports multiple method invocations in a single request (RFC 8620 Section 3.3) but the code doesn't use this.

Describe the solution you'd like

Build a single JMAP request with all operations batched. Handle partial failure with proper error aggregation. Implement transaction rollback on batch failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingciCI / build pipelineenhancementNew feature or requestneeds-responseWaiting on issue author replyperformancePerformance improvementstaleNo activity for extended period

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions