Skip to content
Meshline
SDK 1.1.0 · TypeView source on GitHub

Developer guide · API index

Members on this page

Meshline.Sdk

Meshline.Components

ChannelManager Class

Manages public channel metadata, posts, follows, and local timeline synchronization.

public sealed class ChannelManager : Meshline.Components.ClientComponent

Inheritance System.Object → ClientComponent → ChannelManager

Exceptions

System.ArgumentNullException
The network context in options is null. The options argument is null.

System.ArgumentException
The configured account identifier is invalid.

System.NotSupportedException
The configured account identifier uses an unsupported account namespace.

Constructors

ChannelManager(ClientOptions, DatabaseOptions, RelayClientPool, DeviceManager) Constructor

Manages public channel metadata, posts, follows, and local timeline synchronization.

public ChannelManager(Meshline.Models.Client.ClientOptions options, Meshline.Storage.DatabaseOptions databaseOptions, Meshline.Transport.RelayClientPool relayClients, Meshline.Components.DeviceManager deviceManager);

Parameters

options ClientOptions

The network and account configuration for this component.

databaseOptions DatabaseOptions

The SQLite database configuration; create its parent directory and apply migrations before initialization.

relayClients RelayClientPool

The shared relay pool. The application owns it and must dispose it after all dependent components.

deviceManager DeviceManager

The device component sharing this network, account, database, and relay pool.

Exceptions

System.ArgumentNullException
The network context in options is null. The options argument is null.

System.ArgumentException
The configured account identifier is invalid.

System.NotSupportedException
The configured account identifier uses an unsupported account namespace.

Methods

ChannelManager.CloseChannelAsync(ChannelRef, CancellationToken) Method

Publishes a closed channel descriptor as the channel owner.

public System.Threading.Tasks.Task CloseChannelAsync(Meshline.Models.Client.ChannelRef channel, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

channel ChannelRef

The channel identifier and hosting relay.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task
A task that completes when the operation finishes.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session. The channel is closed, a previous operation is unfinished, or the accepted post or expected descriptor revision is no longer available.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

System.ArgumentException
The channel metadata, post content, or field update violates protocol constraints.

System.UnauthorizedAccessException
The current account is not permitted to publish or modify this channel resource.

System.OverflowException
Incrementing the known descriptor revision exceeds the range of a signed 64-bit integer.

ChannelManager.CreateChannelAsync(string, string, string, IReadOnlyList<string>, CancellationToken) Method

Creates a signed public channel on a relay that supports channel hosting.

public System.Threading.Tasks.Task<Meshline.Models.Client.ChannelInfo> CreateChannelAsync(string relayId, string name, string? description=null, System.Collections.Generic.IReadOnlyList<string>? moderators=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

relayId System.String

The relay's canonical lowercase Neo script-hash identifier.

name System.String

The resource's display name.

description System.String

An optional resource description.

moderators System.Collections.Generic.IReadOnlyList<System.String>

Optional account identifiers permitted to moderate the channel.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task<ChannelInfo>
The created channel's descriptor, reference, and local following state.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
Initialization or the local signing device is unavailable, the relay is inactive, or the new channel has a pending operation or conflicting descriptor revision.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

System.ArgumentException
The relay identifier, channel name, description, or moderator list violates protocol constraints.

ChannelManager.DeletePostAsync(ChannelPostRef, CancellationToken) Method

Publishes a signed deletion for the referenced channel post.

public System.Threading.Tasks.Task DeletePostAsync(Meshline.Models.Client.ChannelPostRef post, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

post ChannelPostRef

The channel and original timeline sequence identifying the post.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task
A task that completes when the operation finishes.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session. The channel is closed, a previous operation is unfinished, or the accepted post or expected descriptor revision is no longer available.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

System.ArgumentException
The channel metadata, post content, or field update violates protocol constraints.

System.UnauthorizedAccessException
The current account is not permitted to publish or modify this channel resource.

ChannelManager.EditPostAsync(ChannelPostRef, ChannelPostUpdate, CancellationToken) Method

Publishes signed field updates to an existing channel post and returns its updated local content.

public System.Threading.Tasks.Task<Meshline.Models.Client.ChannelPostInfo> EditPostAsync(Meshline.Models.Client.ChannelPostRef post, Meshline.Models.Client.ChannelPostUpdate edit, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

post ChannelPostRef

The channel and original timeline sequence identifying the post.

edit ChannelPostUpdate

The body and attachment changes to apply to the referenced post.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task<ChannelPostInfo>
The post's locally materialized content after the edit.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session. The channel is closed, a previous operation is unfinished, or the accepted post or expected descriptor revision is no longer available.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

System.ArgumentException
The channel metadata, post content, or field update violates protocol constraints.

System.UnauthorizedAccessException
The current account is not permitted to publish or modify this channel resource.

ChannelManager.FollowAsync(ChannelRef, CancellationToken) Method

Resolves a channel, records it as locally followed, and requests subscription refresh.

public System.Threading.Tasks.Task FollowAsync(Meshline.Models.Client.ChannelRef channel, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

channel ChannelRef

The channel identifier and hosting relay.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task
A task that completes when the operation finishes.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

Remarks

Following is local to this database. Background subscriptions and synchronization run while the component is started.

ChannelManager.GetChannelAsync(ChannelRef, CancellationToken) Method

Resolves and verifies the channel descriptor and stores the resulting channel information locally.

public System.Threading.Tasks.Task<Meshline.Models.Client.ChannelInfo> GetChannelAsync(Meshline.Models.Client.ChannelRef channel, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

channel ChannelRef

The channel identifier and hosting relay.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task<ChannelInfo>
The resolved channel information and local following state.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

ChannelManager.GetFollowedAsync(string, CancellationToken) Method

Opens a snapshot reader for locally followed channels, optionally restricted to one relay.

public System.Threading.Tasks.Task<Meshline.Storage.QueryReader<Meshline.Models.Client.ChannelInfo>> GetFollowedAsync(string? relayId=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

relayId System.String

An optional hosting relay filter; null includes all values.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task<Meshline.Storage.QueryReader<ChannelInfo>>
A snapshot reader for the matching local results. The caller must dispose the reader after use.

Exceptions

System.OperationCanceledException
The operation observes cancellation of cancellationToken. Disposal of the component or relay session can also cancel pending work.

System.InvalidOperationException
This component or a required component has not completed initialization.

System.ObjectDisposedException
This component or a component used by the operation has been disposed.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Remarks

This query reads local storage without fetching missing relay history. Its snapshot is fixed when opened; dispose the reader promptly and open a new reader to observe later changes.

ChannelManager.GetPostsAsync(string, string, CancellationToken) Method

Opens a snapshot reader for locally stored, undeleted channel posts matching the supplied filters.

public System.Threading.Tasks.Task<Meshline.Storage.QueryReader<Meshline.Models.Client.ChannelPostInfo>> GetPostsAsync(string? channelId=null, string? author=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

channelId System.String

An optional channel identifier filter; null includes all values.

author System.String

An optional author account filter; null includes all authors.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task<Meshline.Storage.QueryReader<ChannelPostInfo>>
A snapshot reader for the matching local results. The caller must dispose the reader after use.

Exceptions

System.OperationCanceledException
The operation observes cancellation of cancellationToken. Disposal of the component or relay session can also cancel pending work.

System.InvalidOperationException
This component or a required component has not completed initialization.

System.ObjectDisposedException
This component or a component used by the operation has been disposed.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Remarks

This query reads local storage without fetching missing relay history. Its snapshot is fixed when opened; dispose the reader promptly and open a new reader to observe later changes.

ChannelManager.LoadChannelHistoryAsync(ChannelRef, PageRequest, CancellationToken) Method

Loads and verifies a backward page of channel events and returns the available posts materialized from that page.

public System.Threading.Tasks.Task<Meshline.Models.Client.Page<Meshline.Models.Client.ChannelPostInfo>> LoadChannelHistoryAsync(Meshline.Models.Client.ChannelRef channel, Meshline.Models.Client.PageRequest? page=null, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

channel ChannelRef

The channel identifier and hosting relay.

page PageRequest

The requested page size and previous continuation cursor, or null for the first default-sized page.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task<Meshline.Models.Client.Page<ChannelPostInfo>>
The available posts from the event page and a cursor for earlier events when more remain.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

System.ArgumentException
The history cursor is not a nonnegative safe integer.

Remarks

Pass the returned NextCursor in the next request to continue toward older events. Deleted posts and non-post events are omitted, so a page can contain fewer posts than requested or no posts while still exposing a next cursor.

ChannelManager.PublishPostAsync(ChannelRef, ChannelPostDraft, CancellationToken) Method

Signs and publishes a public channel post, then returns its locally materialized content.

public System.Threading.Tasks.Task<Meshline.Models.Client.ChannelPostInfo> PublishPostAsync(Meshline.Models.Client.ChannelRef channel, Meshline.Models.Client.ChannelPostDraft draft, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

channel ChannelRef

The channel identifier and hosting relay.

draft ChannelPostDraft

The public post body and attachment references to publish.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task<ChannelPostInfo>
The accepted post's locally materialized content and original sequence.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session. The channel is closed, a previous operation is unfinished, or the accepted post or expected descriptor revision is no longer available.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

System.ArgumentException
The channel metadata, post content, or field update violates protocol constraints.

System.UnauthorizedAccessException
The current account is not permitted to publish or modify this channel resource.

ChannelManager.ReportPostAsync(ChannelPostRef, string, CancellationToken) Method

Reports a channel post to its hosting relay with a supplied reason.

public System.Threading.Tasks.Task ReportPostAsync(Meshline.Models.Client.ChannelPostRef post, string reason, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

post ChannelPostRef

The channel and original timeline sequence identifying the post.

reason System.String

The reason for reporting the post.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task
A task that completes when the operation finishes.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

System.ArgumentException
The post reference or report reason violates protocol constraints.

ChannelManager.UnfollowAsync(ChannelRef, CancellationToken) Method

Clears a channel's local following state and requests subscription refresh.

public System.Threading.Tasks.Task UnfollowAsync(Meshline.Models.Client.ChannelRef channel, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

channel ChannelRef

The channel identifier and hosting relay.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task
A task that completes when the operation finishes.

Exceptions

System.OperationCanceledException
The operation observes cancellation of cancellationToken. Disposal of the component or relay session can also cancel pending work.

System.InvalidOperationException
This component or a required component has not completed initialization.

System.ObjectDisposedException
This component or a component used by the operation has been disposed.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

Remarks

Unfollowing stops future followed-channel synchronization after refresh; it does not delete retained local posts.

ChannelManager.UpdateChannelAsync(ChannelRef, ChannelUpdate, CancellationToken) Method

Publishes a new channel descriptor revision with the supplied field updates as the channel owner.

public System.Threading.Tasks.Task<Meshline.Models.Client.ChannelInfo> UpdateChannelAsync(Meshline.Models.Client.ChannelRef channel, Meshline.Models.Client.ChannelUpdate update, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));

Parameters

channel ChannelRef

The channel identifier and hosting relay.

update ChannelUpdate

The field assignments and deletions to apply; unspecified fields remain unchanged.

cancellationToken System.Threading.CancellationToken

A token that can cancel the operation.

Returns

System.Threading.Tasks.Task<ChannelInfo>
The channel information after publishing the descriptor update.

Exceptions

System.OperationCanceledException
The operation is canceled through cancellationToken, a component or relay lifetime ends, or a relay request times out.

System.InvalidOperationException
This component or a required component has not completed initialization. The local device or its signing keys are unavailable, or no active relay can provide the required session. The channel is closed, a previous operation is unfinished, or the accepted post or expected descriptor revision is no longer available.

System.ObjectDisposedException
This component, a required component, or the shared relay pool has been disposed.

System.Net.Http.HttpRequestException
Relay discovery, authentication, or the HTTP request fails at the transport layer.

RelayException
The relay rejects the operation with a structured protocol error that is not handled by this method.

System.IO.InvalidDataException
Relay evidence or returned state is missing, inconsistent, or fails protocol validation.

System.Text.Json.JsonException
A stored or received protocol document cannot be serialized or deserialized.

System.Text.DecoderFallbackException
A relay response contains bytes that are not valid UTF-8.

Microsoft.Data.Sqlite.SqliteException
The SQLite database cannot be opened or a database command fails, for example because the schema is not migrated or the file is locked.

Microsoft.EntityFrameworkCore.DbUpdateException
Persisting local changes fails, including database constraint or optimistic-concurrency failures.

System.Security.Cryptography.CryptographicException
The local device key cannot be validated against its certificate, or cryptographic signing or verification fails.

System.NotSupportedException
The hosting relay does not advertise channel hosting.

System.ArgumentException
The channel metadata, post content, or field update violates protocol constraints.

System.UnauthorizedAccessException
The current account is not permitted to publish or modify this channel resource.

System.OverflowException
Incrementing the known descriptor revision exceeds the range of a signed 64-bit integer.

Events

ChannelManager.ChannelChanged Event

Occurs when a channel's locally known descriptor changes.

public event EventHandler<ChannelInfo>? ChannelChanged;

Event Type

System.EventHandler<ChannelInfo>

ChannelManager.FollowChanged Event

Occurs when a channel's local following state changes.

public event EventHandler<ChannelFollowChangedEventArgs>? FollowChanged;

Event Type

System.EventHandler<ChannelFollowChangedEventArgs>

ChannelManager.TimelineChanged Event

Occurs when channel post changes are committed to the local timeline.

public event EventHandler<ChannelTimelineChangedEventArgs>? TimelineChanged;

Event Type

System.EventHandler<ChannelTimelineChangedEventArgs>