Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin fails to render a big sequence diagram #30

Open
xSAVIKx opened this issue Apr 11, 2023 · 1 comment
Open

The plugin fails to render a big sequence diagram #30

xSAVIKx opened this issue Apr 11, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@xSAVIKx
Copy link

xSAVIKx commented Apr 11, 2023

Here's a diagram that I was trying to render in the docs:

sequenceDiagram
    participant a as Phone
    box Public-Facing API
    participant proxy as Cloud Run
    participant fcm as FCM
    participant fs as Firestore
    end
    box Cloud Node internal services
    participant pubsub as Pub/Sub
    participant b as HTSS
    participant sql as Cloud SQL
    participant redis as Memory Store
    participant kms as Cloud KMS
    participant iam as Cloud IAM
    participant audit as Cloud Audit Log
    end
    a->>a: Start Workload
    a->>proxy: Send Public Key and Device ID
    proxy->>pubsub: Forward Public Key and Device ID
    b->>pubsub: Receive Public Key and Device ID
    b->>fs: Store Node Public Key under Device ID key
    b->>fcm: Send Public Key notification
    fcm->>a: Notify about Node Public Key
    a->>proxy: Init keygen
    proxy->>pubsub: Forward Keygen init
    b->>pubsub: Receive Keygen init
    b->>b: Create KeyGen
    b->>redis: Cache KeyGen
    b->>sql: Authenticate
    sql->>iam: Verify token
    alt token OK:
        iam->>sql: OK
    else wrong token:
        break when wrong token:
            iam->>audit: Attestation failed: Wrong Token
        end
	end
    b->>sql: Store KeyGen
    par Between Nodes:
        loop Each node to each other:
            b->>fcm: Ask for a KeyGen
            a->>a: Encrypts a KeyGen using Node Public Key
            a->>proxy: Send encrypted KeyGen
            proxy->>pubsub: Forward encrypted KeyGen
            b->>pubsub: Receive encrypted KeyGen
            b->>b: Decrypt KeyGen
            b->>b: Generate key share
            b->>kms: Encrypt key share
            kms->> iam: Verify token
            alt token OK:
                iam->>kms: OK
            else wrong token:
                break when wrong token:         
                    iam->>audit: Attestation failed: Wrong Token
                end
			end
            b->>fs: Store encrypted key share for Phone
            b->>fcm: Send notification about encrypted key share
            fcm->>a: Notify about key share
            b->>sql: Authenticate
            sql->>iam: Verify token
            alt token OK:
                iam->>sql: OK
            else wrong token:
                break when wrong token:         
                    iam->>audit: Attestation failed: Wrong Token
                end
			end
            b->>sql: Store Encrypted Key Share
            b->>redis: Clear KeyGen
        end
    end
sequenceDiagram
    participant a as Phone
    box Public-Facing API
    participant proxy as Cloud Run
    participant fcm as FCM
    participant fs as Firestore
    end
    box Cloud Node internal services
    participant pubsub as Pub/Sub
    participant b as HTSS
    participant sql as Cloud SQL
    participant redis as Memory Store
    participant kms as Cloud KMS
    participant iam as Cloud IAM
    participant audit as Cloud Audit Log
    end
    a->>a: Start Workload
    a->>proxy: Send Public Key and Device ID
    proxy->>pubsub: Forward Public Key and Device ID
    b->>pubsub: Receive Public Key and Device ID
    b->>fs: Store Node Public Key under Device ID key
    b->>fcm: Send Public Key notification
    fcm->>a: Notify about Node Public Key
    a->>proxy: Init keygen
    proxy->>pubsub: Forward Keygen init
    b->>pubsub: Receive Keygen init
    b->>b: Create KeyGen
    b->>redis: Cache KeyGen
    b->>sql: Authenticate
    sql->>iam: Verify token
    alt token OK:
        iam->>sql: OK
    else wrong token:
        break when wrong token:
            iam->>audit: Attestation failed: Wrong Token
        end
	end
    b->>sql: Store KeyGen
    par Between Nodes:
        loop Each node to each other:
            b->>fcm: Ask for a KeyGen
            a->>a: Encrypts a KeyGen using Node Public Key
            a->>proxy: Send encrypted KeyGen
            proxy->>pubsub: Forward encrypted KeyGen
            b->>pubsub: Receive encrypted KeyGen
            b->>b: Decrypt KeyGen
            b->>b: Generate key share
            b->>kms: Encrypt key share
            kms->> iam: Verify token
            alt token OK:
                iam->>kms: OK
            else wrong token:
                break when wrong token:         
                    iam->>audit: Attestation failed: Wrong Token
                end
			end
            b->>fs: Store encrypted key share for Phone
            b->>fcm: Send notification about encrypted key share
            fcm->>a: Notify about key share
            b->>sql: Authenticate
            sql->>iam: Verify token
            alt token OK:
                iam->>sql: OK
            else wrong token:
                break when wrong token:         
                    iam->>audit: Attestation failed: Wrong Token
                end
			end
            b->>sql: Store Encrypted Key Share
            b->>redis: Clear KeyGen
        end
    end

As you can see, GH as well as mermaid.js live editor are able to render it without a glitch. Any help is appreciated.

I assume this may be smth just related to the size of the diagram.

@renanlecaro
Copy link
Owner

Yeah the picture gets too large for gdocs. I'll see if i can do something about it one of those days, in the meantime i'd recommend using multiple smaller diagrams or manually generating them

@renanlecaro renanlecaro added the bug Something isn't working label Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants