terrastruct / d2

D2 is a modern diagram scripting language that turns text to diagrams.
https://d2lang.com
Mozilla Public License 2.0
16.99k stars 421 forks source link

d2sequence error #2081

Closed anuwat-th closed 1 month ago

anuwat-th commented 2 months ago

https://play.d2lang.com/?script=jJLNbuJAEITvfoqSL7tIgMQerRUc9rB7WGl_OCYR6thtz4jxjDPTNkER7x4ZbIL5SXJsq_qrqmn_doW22GhR-OlcYTjBSwQERRUnCPxUs015lWkqPJUROhX-UC1qKjN8n-DA-EsFT2WW4H-7FKRXUpq62goyEppGVwiT-SUhVM4GvokY6K8A_tXst4i5JG3iMeJc-yCwVHI7GeqHe5t7V_Y2vrO96rBk37AfFNxrvsaec89BrcSt2cbjzvWm56jFH2ln6B-K03UfHDqAn3UQbQu4HNbJIgLIyOFIQHx3InmI-8_v8D2TMCxv0OY2b7m7xdPe39rjDnp3ZznvPPrAdckCbSkV3TCoIW3o0TBy51F5brSrw6fiTOb45Urezwk2igSZzrB1NRQ1B6CpbaoW-_Vd90ZsAl8-zvC3SSCK5EtAxT44S-ZI2EW76DUAAP__&theme=1&sketch=0&layout=dagre&

bo-ku-ra commented 2 months ago

https://play.d2lang.com/?script=pJJPb9RADMXv8yme0gNU2mTVHiPUCnGAAxJ_egRUuYmTGXUyEzzOLhXqd0fZTdrd7hYQ5BSP7Pfzs_0-ti5g7dTibYyt5xI_DZAs9Vwi8feBQ8XXtaNWqDMGOMn_8RtrYVX7VC6X9bmn0BZV7JYaB1nOpHwipZMoNYsL7absdaVREtbOe1DfMwkaiR08N5przMW1VkEJtMDNAtUCdVEUBpMpfKBBrQG2dj9SywZ4Fzue_69YViz_Ze8JrdAzvMp3iIWelfg8-kw6Z1JVxSEoalIqjinkF4cKqY8h8bMSe_lHBD4NLHfIuCPnswWyxklSBOp4jDzNwdewGfGEkQl7lLCd3p7BTc7LTLgRTvZa4y2HbDFRn2WemoddHEq_sVzdzo3DJfAPl9SFFrFBiHppAPK6vWAg-7KT8i2bn3-jL0zKCLzG2Ld_7Hsq3PV9Pi53z_e0lqeeT_9AvWKFC1SpWzFoRc7TjWc0UdALr1wc0l-1k188HnSJtSVF7WrcxQGWVltBP4TKXm7K76cZsU98OJz9symhlvRFQs-SYiD_oHBv7s2vAAAA__8%3D&theme=1&sketch=0&layout=dagre&

Login with Google: {
  shape: sequence_diagram

  # --------------------------------------------------------
  # https://d2lang.com/tour/sequence-diagrams#ordering
  # Actors will appear from left-to-right as a, b, c, d...
  Google Oauth
  Login Page
  Home Page  # <-- necessary
  Server
  # --------------------------------------------------------

  Google Oauth.t1 <- Login Page.t1: Request Google account data.

  Google Oauth.t1 -> Login Page.t1: Response Google account data.

  Login Page.t1 -> Login Page.t1: Query "email", "first name", "last name"\nfrom Google response

  Login Page.t1 -> Server.t1: Request Login("refresh_token","email""first name", "last name")

  Server.t1 -> Server.t1: Check "email" is existing of not?
  alt: {
    "[is existing]": {
      Server.t1 -> Server.t1: Create new "reflesh_token"
      Login Page.t2 <- Server.t1: Response ("refresh_token")
      Server.t1 -> Server.t1: Set inactive available for previous "reflesh_token"
      Login Page.t2 -> Home Page: what did you have for lunch?
    }
    "[else]": {
      Server -> Login Page: that's personal
    }
  }
}
bo-ku-ra commented 2 months ago

i don't know, why not accept both d2-sources?

alixander commented 2 months ago

Regardless, there should be better error messages so this is a bug

alixander commented 1 month ago

dupe https://github.com/terrastruct/d2/issues/2092