Skip to content

Comments

docs: update getDeviceData documentation with detailed usage and examples#3

Closed
aiko-chan-ai wants to merge 1 commit intomainfrom
jsdoc
Closed

docs: update getDeviceData documentation with detailed usage and examples#3
aiko-chan-ai wants to merge 1 commit intomainfrom
jsdoc

Conversation

@aiko-chan-ai
Copy link
Member

tks copilot

@aiko-chan-ai aiko-chan-ai changed the title docs: update getDeviceData documentation with detailed usage and exam… docs: update getDeviceData documentation with detailed usage and examples Feb 3, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the documentation for the getDeviceData() method across three files: the TypeScript source code (src/client.ts) and both English and Vietnamese documentation files (DOCS.md and DOCS_VI.md). The documentation is enhanced with detailed explanations of what device data includes, usage examples, and descriptions of device store modes. Additionally, the PR includes an unrelated change to .gitattributes that enforces LF line endings.

Changes:

  • Enhanced JSDoc comments for getDeviceData() in src/client.ts with detailed usage information and examples
  • Updated DOCS.md with comprehensive documentation including device store modes table and database storage examples
  • Updated DOCS_VI.md (Vietnamese) with equivalent documentation changes

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/client.ts Enhanced JSDoc documentation for getDeviceData() method with detailed explanation and database usage example
DOCS.md Expanded documentation with device store modes table, use cases, and additional code examples
DOCS_VI.md Vietnamese translation of the expanded documentation
.gitattributes Added eol=lf to enforce LF line endings (unrelated to documentation update)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* - All sessions and identities
*
* Works with all device store modes:
* - `e2eeMemoryOnly: true` - Get the ephemeral device data before it's lost
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references a non-existent option e2eeMemoryOnly: true. Based on the ClientOptions interface in src/types.ts (lines 388-401), the available device store options are only devicePath and deviceData. Memory-only mode is implicitly enabled when neither option is provided to the Client constructor. The correct documentation should reflect this: when neither devicePath nor deviceData is specified, the device data is only stored in memory and lost on disconnect.

Suggested change
* - `e2eeMemoryOnly: true` - Get the ephemeral device data before it's lost
* - In-memory mode (default when neither `devicePath` nor `deviceData` is set) - Get the ephemeral device data before it's lost

Copilot uses AI. Check for mistakes.
Comment on lines +1084 to +1086
| `e2eeMemoryOnly: true` | Get the ephemeral device data before it's lost on disconnect |
| `deviceData: "..."` | Get the updated state after sessions/keys change |
| `devicePath: "..."` | Get current state (also auto-saved to file) |
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references a non-existent option e2eeMemoryOnly: true. Based on the ClientOptions interface in src/types.ts (lines 388-401), the available device store options are only devicePath and deviceData. Memory-only mode is implicitly enabled when neither option is provided. Update the table to correctly describe the actual device store modes: no options specified (memory-only), deviceData specified, or devicePath specified.

Suggested change
| `e2eeMemoryOnly: true` | Get the ephemeral device data before it's lost on disconnect |
| `deviceData: "..."` | Get the updated state after sessions/keys change |
| `devicePath: "..."` | Get current state (also auto-saved to file) |
| _No device store options specified_ | Memory-only mode: get ephemeral device data before it's lost on disconnect |
| `deviceData: "..."` | In-memory + caller-managed persistence: get the updated state after sessions/keys change |
| `devicePath: "..."` | File-based persistence: get current state (also auto-saved to file) |

Copilot uses AI. Check for mistakes.

| Chế độ | Mô tả |
|------|-------------|
| `e2eeMemoryOnly: true` | Lấy dữ liệu tạm thời trước khi mất khi ngắt kết nối |
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation references a non-existent option e2eeMemoryOnly: true. Based on the ClientOptions interface in src/types.ts (lines 388-401), the available device store options are only devicePath and deviceData. Memory-only mode is implicitly enabled when neither option is provided. Update the table to correctly describe the actual device store modes: no options specified (memory-only), deviceData specified, or devicePath specified.

Suggested change
| `e2eeMemoryOnly: true` | Lấy dữ liệu tạm thời trước khi mất khi ngắt kết nối |
| Không cấu hình device store (không truyền `devicePath` hoặc `deviceData`) | Lấy dữ liệu tạm thời trong memory-only mode trước khi mất khi ngắt kết nối |

Copilot uses AI. Check for mistakes.
@aiko-chan-ai aiko-chan-ai deleted the jsdoc branch February 3, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant