Commit 81c1c9e
fix(cloud): resolve project ownerSeed via sys_user lookup, not session re-probe
The dispatcher already runs a session-resolve block earlier when
created_by === '__session__' (line ~1762), which populates req.created_by
with the user id. A subsequent getSession() call to fetch user details
(email/name/image) was unreliable because the cloud project-create route
is often invoked via an internal RPC that does not carry the original
browser cookies — so getSession() returned null and ownerSeed was never
written into project metadata.
Fix: prefer req.created_by (already an authenticated user id at this
point) and look up the user row directly via objectql for email/name/
image. Falls back to the legacy session probe when created_by is not
available (e.g. CLI scripts that don't use the __session__ placeholder).
This unblocks Plan A end-to-end:
1. orgSeed (already shipped) mirrors the owning cloud org.
2. ownerSeed (this commit) replays the owner as sys_user.
3. seedProjectMember binds the owner to the mirrored cloud org,
skipping SecurityPlugin's auto-personal-workspace middleware.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 7bed32e commit 81c1c9e
1 file changed
Lines changed: 55 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1873 | 1873 | | |
1874 | 1874 | | |
1875 | 1875 | | |
1876 | | - | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
1877 | 1885 | | |
1878 | | - | |
1879 | | - | |
1880 | | - | |
1881 | | - | |
1882 | | - | |
1883 | | - | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
1884 | 1926 | | |
1885 | | - | |
1886 | | - | |
1887 | | - | |
1888 | | - | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
1889 | 1931 | | |
1890 | 1932 | | |
1891 | 1933 | | |
1892 | | - | |
1893 | | - | |
1894 | | - | |
| 1934 | + | |
| 1935 | + | |
1895 | 1936 | | |
1896 | 1937 | | |
1897 | 1938 | | |
| |||
0 commit comments