Skip to content

Instantly share code, notes, and snippets.

@bills-appworks
Last active February 20, 2025 10:26
Show Gist options
  • Select an option

  • Save bills-appworks/0123ae7ab79e0b754692c6e817de3fd7 to your computer and use it in GitHub Desktop.

Select an option

Save bills-appworks/0123ae7ab79e0b754692c6e817de3fd7 to your computer and use it in GitHub Desktop.
Bluesky video post sequence
@startuml
skinparam monochrome reverse
skinparam sequence {
GroupBackgroundColor Aqua
}
"client" -> "PDS" : <b>1</b> getServiceAuth
activate "PDS"
"client" <-- "PDS" : <b>2</b>
deactivate "PDS"
"client" -> "video" : <b>3</b> uploadVideo
activate "video"
"client" <-- "video" : <b>4</b>
group loop
par
"client" -> "PDS" : <b>5</b> getJobStatus
activate "PDS"
"PDS" -> "video" : <b>6</b> getJobStatus
activate "video"
"PDS" <-- "video" : <b>7</b>
deactivate "video"
else
"PDS" <- "video" : <b>8</b> uploadBlob
activate "PDS"
"PDS" --> "video" : <b>9</b>
deactivate "PDS"
deactivate "video"
end "par"
"client" <-- "PDS": <b>10</b>
deactivate "PDS"
end "loop"
"client" -> "PDS" : <b>11</b> createRecord
activate "PDS"
"PDS" -> "relay" : <b>12</b> commit event
"client" <-- "PDS" : <b>13</b>
deactivate "PDS"
"relay" -> "bsky" : <b>14</b> commit event
"client" -> "PDS" : <b>15</b> getTimeline
activate "PDS"
"PDS" -> "bsky" : <b>16</b> getTimeline
activate "bsky"
"PDS" <-- "bsky" : <b>17</b>
deactivate "bsky"
"client" <-- "PDS" : <b>18</b>
deactivate "PDS"
"client" -> "video" : <b>19</b> fetch video
activate "video"
"client" <-- "video" : <b>20</b>
deactivate "video"
@enduml
@startuml
skinparam monochrome reverse
skinparam sequence {
GroupBackgroundColor Aqua
}
box "client"
participant Main [
""client""
----
""main""
]
participant Polling [
""client""
----
""polling""
]
end box
Main -> "PDS" : <b>1</b> getServiceAuth
activate "PDS"
Main <-- "PDS" : <b>2</b>
deactivate "PDS"
Main -> "video" : <b>3</b> uploadVideo
activate "video"
Main <-- "video" : <b>4</b>
par
create Polling
Main -> Polling : <b>5</b>
loop
Polling -> "PDS" : <b>6</b> getJobStatus
activate "PDS"
"PDS" -> "video" : <b>7</b> getJobStatus
activate "video"
"PDS" <-- "video" : <b>8</b>
deactivate "video"
Polling <-- "PDS": <b>9</b>
deactivate "PDS"
break jobStatus.state =\n JOB_STATE_COMPLETED |\n JOB_STATE_FAILED
Main <-- Polling : <b>10</b>
end break
end loop
destroy Polling
else
"PDS" <- "video" : <b>11</b> uploadBlob
note right
use PDS auth
end note
activate "PDS"
... Delay due to upload ...
"PDS" --> "video" : <b>12</b>
note right
jobStatus.state set to
JOB_STATE_COMPLETED or
JOB_STATE_FAILED
end note
deactivate "PDS"
deactivate "video"
end par
note right
polling and
uploadBlob
in pallarel
end note
Main -> "PDS" : <b>13</b> createRecord
activate "PDS"
"PDS" ->> "relay" : <b>14</b> commit event
Main <-- "PDS" : <b>15</b>
deactivate "PDS"
"relay" ->> "bsky" : <b>16</b> commit event
Main -> "PDS" : <b>17</b> getTimeline
activate "PDS"
"PDS" -> "bsky" : <b>18</b> getTimeline
activate "bsky"
"PDS" <-- "bsky" : <b>19</b>
deactivate "bsky"
Main <-- "PDS" : <b>20</b>
deactivate "PDS"
Main -> "video" : <b>21</b> fetch video
activate "video"
Main <-- "video" : <b>22</b>
deactivate "video"
@enduml
@startuml
skinparam monochrome reverse
skinparam sequence {
GroupBackgroundColor Aqua
}
box "client"
participant Main [
client
----
main
]
participant Polling [
client
----
polling
]
end box
participant PDS [
PDS
]
participant Video [
video
]
participant Relay [
relay
]
participant Bsky [
bsky
]
autonumber
== getUploadLimit ==
note over Main, bsky
processing getUploadLimit is optional
end note
Main -> PDS : getServiceAuth
note right
aud: did:web:video.bsky.app
lxm: app.bsky.video.getUploadLimit
end note
activate PDS
Main <-- PDS
deactivate PDS
note over Main, Video
this case via PDS using atproto-proxy
alt way: direct from client to video
end note
Main -> PDS : getUploadLimit
activate PDS
PDS -> Video : getUploadLimit
activate Video
PDS <-- Video
deactivate Video
Main <-- PDS
deactivate PDS
== uploadVideo ==
Main -> PDS : getServiceAuth
note right
aud: <i>DID of PDS</i>
lxm: com.atproto.repo.uploadBlob
end note
activate PDS
Main <-- PDS
deactivate PDS
note over Main, Video
this case via PDS using atproto-proxy
alt way: direct from client to video
end note
Main -> PDS : uploadVideo
activate PDS
PDS -> Video : uploadVideo
activate Video
PDS <-- Video
note right
jobStatus.state set to
JOB_STATE_CREATED
end note
Main <-- PDS
deactivate PDS
== getJobStatus ==
note over Main, Video
client polling and video uploadBlob in parallel
end note
par
create Polling
Main -> Polling
note over Polling, PDS
getServiceAuth can also be
used in a loop
end note
Polling -> PDS : getServiceAuth
activate PDS
note right
aud: did:web:video.bsky.app
lxm: app.bsky.video.getJobStatus
end note
Polling <-- PDS
deactivate PDS
loop
note over Main, Video
this case via PDS using atproto-proxy
alt way: direct from client to video
end note
Polling -> PDS : getJobStatus
activate PDS
PDS -> Video : getJobStatus
activate Video
PDS <-- Video
deactivate Video
Polling <-- PDS
deactivate PDS
break jobStatus.state =\n JOB_STATE_COMPLETED |\n JOB_STATE_FAILED
Main <-- Polling
end break
end loop
destroy Polling
else
|||
... delay due to encoding, scanning, upload ...
note over Video
video encoding and scanning
----
jobStatus.state set to
JOB_STATE_ENCODING or
JOB_STATE_SCANNING
end note
PDS <- Video : uploadBlob
note right
Job use PDS auth
end note
activate PDS
PDS --> Video
note right
jobStatus.state set to
JOB_STATE_COMPLETED or
JOB_STATE_FAILED
end note
deactivate PDS
deactivate Video
end par
== post, timeline, fetch video ==
Main -> PDS : createRecord
activate PDS
PDS ->> Relay : commit event
Main <-- PDS
deactivate PDS
Relay ->> Bsky : commit event
Main -> PDS : getTimeline
activate PDS
PDS -> Bsky : getTimeline
activate Bsky
PDS <-- Bsky
deactivate Bsky
Main <-- PDS
deactivate PDS
Main -> Video : fetch video
activate Video
Main <-- Video
deactivate Video
@enduml
@startuml
skinparam monochrome reverse
skinparam sequence {
GroupBackgroundColor Aqua
}
box "client"
participant Main [
client
----
main
]
participant Polling [
client
----
polling
]
end box
participant PDS [
PDS
]
participant Video [
video
]
participant Relay [
relay
]
participant Bsky [
bsky
]
autonumber
'== getUploadLimit ==
' note over Main, bsky
' processing getUploadLimit is optional
' end note
' Main -> PDS : getServiceAuth
' note right
' aud: did:web:video.bsky.app
' lxm: app.bsky.video.getUploadLimit
' end note
' activate PDS
' Main <-- PDS
' deactivate PDS
' note over Main, Video
' this case via PDS using atproto-proxy
' alt way: direct from client to video
' end note
' Main -> PDS : getUploadLimit
' activate PDS
' PDS -> Video : getUploadLimit
' activate Video
' PDS <-- Video
' deactivate Video
' Main <-- PDS
' deactivate PDS
'== uploadVideo ==
Main -> PDS : getServiceAuth
' note right
' aud: <i>DID of PDS</i>
' lxm: com.atproto.repo.uploadBlob
' end note
activate PDS
Main <-- PDS
deactivate PDS
' note over Main, Video
' this case via PDS using atproto-proxy
' alt way: direct from client to video
' end note
Main -> PDS : uploadVideo
activate PDS
PDS -> Video : uploadVideo
activate Video
PDS <-- Video
' note right
' jobStatus.state set to
' JOB_STATE_CREATED
' end note
Main <-- PDS
deactivate PDS
'== getJobStatus ==
' note over Main, Video
' client polling and video uploadBlob in parallel
' end note
par
create Polling
Main -> Polling
' note over Polling, PDS
' getServiceAuth can also be
' used in a loop
' end note
Polling -> PDS : getServiceAuth
activate PDS
' note right
' aud: did:web:video.bsky.app
' lxm: app.bsky.video.getJobStatus
' end note
Polling <-- PDS
deactivate PDS
loop
' note over Main, Video
' this case via PDS using atproto-proxy
' alt way: direct from client to video
' end note
Polling -> PDS : getJobStatus
activate PDS
PDS -> Video : getJobStatus
activate Video
PDS <-- Video
deactivate Video
Polling <-- PDS
deactivate PDS
break jobStatus.state =\n JOB_STATE_COMPLETED |\n JOB_STATE_FAILED
Main <-- Polling
end break
end loop
destroy Polling
else
' |||
' ... delay due to encoding, scanning, upload ...
' note over Video
' video encoding and scanning
' ----
' jobStatus.state set to
' JOB_STATE_ENCODING or
' JOB_STATE_SCANNING
' end note
PDS <- Video : uploadBlob
' note right
' Job use PDS auth
' end note
activate PDS
PDS --> Video
' note right
' jobStatus.state set to
' JOB_STATE_COMPLETED or
' JOB_STATE_FAILED
' end note
deactivate PDS
deactivate Video
end par
'== post, timeline, fetch video ==
Main -> PDS : createRecord
activate PDS
PDS ->> Relay : commit event
Main <-- PDS
deactivate PDS
Relay ->> Bsky : commit event
Main -> PDS : getTimeline
activate PDS
PDS -> Bsky : getTimeline
activate Bsky
PDS <-- Bsky
deactivate Bsky
Main <-- PDS
deactivate PDS
Main -> Video : fetch video
activate Video
Main <-- Video
deactivate Video
@enduml
@startuml
skinparam monochrome reverse
skinparam sequence {
GroupBackgroundColor Aqua
}
box "client"
participant Main [
main
]
participant Polling [
polling
]
end box
participant PDS [
PDS
]
participant Video [
video
]
participant Relay [
relay
]
participant Bsky [
bsky
]
autonumber
== getUploadLimit ==
note over Main, Bsky
processing getUploadLimit is optional
end note
Main -> PDS : getServiceAuth
note right
aud: did:web:video.bsky.app
lxm: app.bsky.video.getUploadLimit
end note
activate PDS
Main <-- PDS
deactivate PDS
note over Main, Video
this case direct from client to video
(probably) alt way: via PDS using atproto-proxy
end note
Main -> Video : getUploadLimit
activate Video
Main <-- Video
deactivate Video
== uploadVideo ==
Main -> PDS : getServiceAuth
note right
aud: <i>DID of PDS</i>
lxm: com.atproto.repo.uploadBlob
end note
activate PDS
Main <-- PDS
deactivate PDS
note over Main, Video
this case direct from client to video
(probably) alt way: via PDS using atproto-proxy
end note
Main -> Video : uploadVideo
activate Video
Main <-- Video
note right
jobStatus.state set to
JOB_STATE_CREATED
end note
== getJobStatus ==
note over Main, Video
client polling and video upload job in parallel
end note
par
create Polling
Main -> Polling
activate Polling
note over Polling, PDS
getServiceAuth can also be
used in a loop
end note
Polling -> PDS : getServiceAuth
activate PDS
note right
aud: did:web:video.bsky.app
lxm: app.bsky.video.getJobStatus
end note
Polling <-- PDS
deactivate PDS
loop
note over Main, Video
this case direct from client to video
(probably) alt way: via PDS using atproto-proxy
end note
Polling -> Video : getJobStatus
activate Video
Polling <-- Video
deactivate Video
break jobStatus.state =\n JOB_STATE_COMPLETED |\n JOB_STATE_FAILED
Main <-- Polling
end break
end loop
deactivate Polling
destroy Polling
else
note over Video
upload job
end note
... delay due to encoding, scanning, upload ...
note over Video
video encoding and scanning
----
jobStatus.state set to
JOB_STATE_ENCODING or
JOB_STATE_SCANNING
end note
PDS <- Video : uploadBlob
note right
uploadBlob use PDS auth
end note
activate PDS
PDS --> Video
note right
jobStatus.state set to
JOB_STATE_COMPLETED or
JOB_STATE_FAILED
end note
deactivate PDS
deactivate Video
end par
== post, timeline, fetch video ==
Main -> PDS : createRecord
activate PDS
PDS ->> Relay : commit event
Main <-- PDS
deactivate PDS
Relay ->> Bsky : commit event
Main -> PDS : getTimeline
activate PDS
PDS -> Bsky : getTimeline
activate Bsky
PDS <-- Bsky
deactivate Bsky
Main <-- PDS
deactivate PDS
Main -> Video : fetch video
activate Video
Main <-- Video
deactivate Video
@enduml
@startuml
skinparam monochrome reverse
skinparam sequence {
GroupBackgroundColor Aqua
}
box "client"
participant Main [
main
]
participant Polling [
polling
]
end box
participant PDS [
PDS
]
participant Video [
video
]
participant Relay [
relay
]
participant Bsky [
bsky
]
autonumber
'== getUploadLimit ==
' note over Main, Bsky
' processing getUploadLimit is optional
' end note
' Main -> PDS : getServiceAuth
' note right
' aud: did:web:video.bsky.app
' lxm: app.bsky.video.getUploadLimit
' end note
' activate PDS
' Main <-- PDS
' deactivate PDS
' note over Main, Video
' this case direct from client to video
' (probably) alt way: via PDS using atproto-proxy
' end note
' Main -> Video : getUploadLimit
' activate Video
' Main <-- Video
' deactivate Video
'== uploadVideo ==
Main -> PDS : getServiceAuth
' note right
' aud: <i>DID of PDS</i>
' lxm: com.atproto.repo.uploadBlob
' end note
activate PDS
Main <-- PDS
deactivate PDS
' note over Main, Video
' this case direct from client to video
' (probably) alt way: via PDS using atproto-proxy
' end note
Main -> Video : uploadVideo
activate Video
Main <-- Video
' note right
' jobStatus.state set to
' JOB_STATE_CREATED
' end note
'== getJobStatus ==
' note over Main, Video
' client polling and video upload job in parallel
' end note
par
create Polling
Main -> Polling
activate Polling
' note over Polling, PDS
' getServiceAuth can also be
' used in a loop
' end note
Polling -> PDS : getServiceAuth
activate PDS
' note right
' aud: did:web:video.bsky.app
' lxm: app.bsky.video.getJobStatus
' end note
Polling <-- PDS
deactivate PDS
loop
' note over Main, Video
' this case direct from client to video
' (probably) alt way: via PDS using atproto-proxy
' end note
Polling -> Video : getJobStatus
activate Video
Polling <-- Video
deactivate Video
break jobStatus.state =\n JOB_STATE_COMPLETED |\n JOB_STATE_FAILED
Main <-- Polling
end break
end loop
deactivate Polling
destroy Polling
else
' note over Video
' upload job
' end note
' ... delay due to encoding, scanning, upload ...
' note over Video
' video encoding and scanning
' ----
' jobStatus.state set to
' JOB_STATE_ENCODING or
' JOB_STATE_SCANNING
' end note
PDS <- Video : uploadBlob
' note right
' uploadBlob use PDS auth
' end note
activate PDS
PDS --> Video
' note right
' jobStatus.state set to
' JOB_STATE_COMPLETED or
' JOB_STATE_FAILED
' end note
deactivate PDS
deactivate Video
end par
'== post, timeline, fetch video ==
Main -> PDS : createRecord
activate PDS
PDS ->> Relay : commit event
Main <-- PDS
deactivate PDS
Relay ->> Bsky : commit event
Main -> PDS : getTimeline
activate PDS
PDS -> Bsky : getTimeline
activate Bsky
PDS <-- Bsky
deactivate Bsky
Main <-- PDS
deactivate PDS
Main -> Video : fetch video
activate Video
Main <-- Video
deactivate Video
@enduml
@startuml
skinparam monochrome reverse
skinparam sequence {
GroupBackgroundColor Aqua
}
box "client"
participant Main [
main
]
participant Polling [
polling
]
end box
participant PDS [
PDS
]
participant Video [
video
]
participant Relay [
relay
]
participant Bsky [
bsky
]
autonumber
== getUploadLimits ==
note over Main, Bsky
processing getUploadLimits is optional
end note
note over Main, Bsky
this case getUploadLimits call direct from client to video
alt way: call via PDS using atproto-proxy, then getServiceAuth is unnecessary
end note
Main -> PDS : getServiceAuth
note right
aud: did:web:video.bsky.app
lxm: app.bsky.video.getUploadLimits
end note
activate PDS
Main <-- PDS
deactivate PDS
Main -> Video : getUploadLimits
activate Video
Main <-- Video
deactivate Video
== uploadVideo ==
note over Main, Bsky
In uploadVideo, calls via PDS using atproto-proxy will not be possible
due to uploadBlob authorization reasons
end note
Main -> PDS : getServiceAuth
note right
aud: <i>DID of PDS</i>
lxm: com.atproto.repo.uploadBlob
end note
activate PDS
Main <-- PDS
deactivate PDS
Main -> Video : uploadVideo
activate Video
Main <-- Video
note right
jobStatus.state set to
JOB_STATE_CREATED
end note
== getJobStatus ==
note over Main, Video
client polling and video upload job in parallel
end note
par
create Polling
Main -> Polling
activate Polling
note over Main, Bsky
this case getJobStatus call direct from client to video
alt way: call via PDS using atproto-proxy, then getServiceAuth is unnecessary
end note
note over Polling, PDS
getServiceAuth can also be
used in a loop
end note
Polling -> PDS : getServiceAuth
activate PDS
note right
aud: did:web:video.bsky.app
lxm: app.bsky.video.getJobStatus
end note
Polling <-- PDS
deactivate PDS
loop
Polling -> Video : getJobStatus
activate Video
Polling <-- Video
deactivate Video
break jobStatus.state =\n JOB_STATE_COMPLETED |\n JOB_STATE_FAILED
Main <-- Polling
end break
end loop
deactivate Polling
destroy Polling
else
note over Video
upload job
end note
... delay due to encoding, scanning, upload ...
note over Video
video encoding and scanning
----
jobStatus.state set to
JOB_STATE_ENCODING or
JOB_STATE_SCANNING
end note
PDS <- Video : uploadBlob
note right
uploadBlob use PDS auth
end note
activate PDS
PDS --> Video
note right
jobStatus.state set to
JOB_STATE_COMPLETED or
JOB_STATE_FAILED
end note
deactivate PDS
deactivate Video
end par
== post, timeline, fetch video ==
Main -> PDS : createRecord
activate PDS
PDS ->> Relay : commit event
Main <-- PDS
deactivate PDS
Relay ->> Bsky : commit event
Main -> PDS : getTimeline
activate PDS
PDS -> Bsky : getTimeline
activate Bsky
PDS <-- Bsky
deactivate Bsky
Main <-- PDS
deactivate PDS
Main -> Video : fetch video
activate Video
Main <-- Video
deactivate Video
@enduml
@startuml
skinparam monochrome reverse
skinparam sequence {
GroupBackgroundColor Aqua
}
box "client"
participant Main [
main
]
participant Polling [
polling
]
end box
participant PDS [
PDS
]
participant Video [
video
]
participant Relay [
relay
]
participant Bsky [
bsky
]
autonumber
'== getUploadLimits ==
' note over Main, Bsky
' processing getUploadLimits is optional
' end note
' note over Main, Bsky
' this case getUploadLimits call direct from client to video
' alt way: call via PDS using atproto-proxy, then getServiceAuth is unnecessary
' end note
' Main -> PDS : getServiceAuth
' note right
' aud: did:web:video.bsky.app
' lxm: app.bsky.video.getUploadLimits
' end note
' activate PDS
' Main <-- PDS
' deactivate PDS
' Main -> Video : getUploadLimits
' activate Video
' Main <-- Video
' deactivate Video
'== uploadVideo ==
' note over Main, Bsky
' In uploadVideo, calls via PDS using atproto-proxy will not be possible
' due to uploadBlob authorization reasons
' end note
Main -> PDS : getServiceAuth
' note right
' aud: <i>DID of PDS</i>
' lxm: com.atproto.repo.uploadBlob
' end note
activate PDS
Main <-- PDS
deactivate PDS
Main -> Video : uploadVideo
activate Video
Main <-- Video
' note right
' jobStatus.state set to
' JOB_STATE_CREATED
' end note
'== getJobStatus ==
' note over Main, Video
' client polling and video upload job in parallel
' end note
par
create Polling
Main -> Polling
activate Polling
' note over Main, Bsky
' this case getJobStatus call direct from client to video
' alt way: call via PDS using atproto-proxy, then getServiceAuth is unnecessary
' end note
' note over Polling, PDS
' getServiceAuth can also be
' used in a loop
' end note
Polling -> PDS : getServiceAuth
activate PDS
' note right
' aud: did:web:video.bsky.app
' lxm: app.bsky.video.getJobStatus
' end note
Polling <-- PDS
deactivate PDS
loop
Polling -> Video : getJobStatus
activate Video
Polling <-- Video
deactivate Video
break jobStatus.state =\n JOB_STATE_COMPLETED |\n JOB_STATE_FAILED
Main <-- Polling
end break
end loop
deactivate Polling
destroy Polling
else
' note over Video
' upload job
' end note
' ... delay due to encoding, scanning, upload ...
' note over Video
' video encoding and scanning
' ----
' jobStatus.state set to
' JOB_STATE_ENCODING or
' JOB_STATE_SCANNING
' end note
PDS <- Video : uploadBlob
' note right
' uploadBlob use PDS auth
' end note
activate PDS
PDS --> Video
' note right
' jobStatus.state set to
' JOB_STATE_COMPLETED or
' JOB_STATE_FAILED
' end note
deactivate PDS
deactivate Video
end par
'== post, timeline, fetch video ==
Main -> PDS : createRecord
activate PDS
PDS ->> Relay : commit event
Main <-- PDS
deactivate PDS
Relay ->> Bsky : commit event
Main -> PDS : getTimeline
activate PDS
PDS -> Bsky : getTimeline
activate Bsky
PDS <-- Bsky
deactivate Bsky
Main <-- PDS
deactivate PDS
Main -> Video : fetch video
activate Video
Main <-- Video
deactivate Video
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment