145 lines
3.7 KiB
Markdown
145 lines
3.7 KiB
Markdown
# Verify Integration IDs Are Being Saved
|
|
|
|
## 🔍 Current Status
|
|
|
|
From your deletion logs, I can see:
|
|
- ✅ `API key present { present: true }` - N8N_API_KEY is now set!
|
|
- ✅ Deletion workflow executes successfully
|
|
- ⚠️ `hasRepoName: false` - Mission had no integration IDs
|
|
|
|
**This suggests**: The mission was created **before** the fixes were applied, so it didn't have integration IDs.
|
|
|
|
---
|
|
|
|
## ✅ Next Steps: Verify IDs Are Being Saved
|
|
|
|
### Step 1: Create a New Mission
|
|
|
|
1. Create a new mission via the frontend
|
|
2. Wait for N8N workflow to complete (30-60 seconds)
|
|
3. Check the server logs for:
|
|
```
|
|
Mission Created Webhook Received ← Should appear now!
|
|
Received mission-created data: { ... }
|
|
Found mission: { id: "...", name: "..." }
|
|
Updating giteaRepositoryUrl: ...
|
|
Updating leantimeProjectId: ...
|
|
Mission updated successfully
|
|
```
|
|
|
|
### Step 2: Check Database
|
|
|
|
**Query the database** to verify IDs are saved:
|
|
|
|
```sql
|
|
SELECT
|
|
id,
|
|
name,
|
|
giteaRepositoryUrl,
|
|
leantimeProjectId,
|
|
outlineCollectionId,
|
|
rocketChatChannelId,
|
|
createdAt
|
|
FROM "Mission"
|
|
WHERE createdAt > NOW() - INTERVAL '1 hour'
|
|
ORDER BY createdAt DESC;
|
|
```
|
|
|
|
**Expected**: Recent missions should have integration IDs populated (not null).
|
|
|
|
### Step 3: Check Server Logs During Creation
|
|
|
|
**Look for these logs** when creating a mission:
|
|
|
|
```
|
|
Starting N8N workflow
|
|
POST /mission-created 200 ← N8N receiving webhook
|
|
Mission Created Webhook Received ← Our endpoint being called! ✅
|
|
Received mission-created data: { ... }
|
|
Updating giteaRepositoryUrl: ...
|
|
Updating leantimeProjectId: ...
|
|
Mission updated successfully
|
|
```
|
|
|
|
**If you see "Mission Created Webhook Received"**: ✅ IDs are being saved!
|
|
|
|
**If you DON'T see it**: ❌ N8N is still not calling the endpoint correctly.
|
|
|
|
---
|
|
|
|
## 🧪 Test Checklist
|
|
|
|
After creating a new mission:
|
|
|
|
- [ ] Server logs show "Mission Created Webhook Received"
|
|
- [ ] Server logs show "Updating giteaRepositoryUrl" (if Gitea was created)
|
|
- [ ] Server logs show "Updating leantimeProjectId" (if Leantime was created)
|
|
- [ ] Server logs show "Updating outlineCollectionId" (if Outline was created)
|
|
- [ ] Server logs show "Updating rocketChatChannelId" (if RocketChat was created)
|
|
- [ ] Server logs show "Mission updated successfully"
|
|
- [ ] Database query shows non-null integration IDs
|
|
- [ ] Mission deletion receives non-empty IDs
|
|
|
|
---
|
|
|
|
## 📊 Expected vs Actual
|
|
|
|
### Expected (After Fix)
|
|
|
|
**Mission Creation Logs**:
|
|
```
|
|
Starting N8N workflow
|
|
POST /mission-created 200
|
|
Mission Created Webhook Received ✅
|
|
Received mission-created data: { missionId: "...", ... }
|
|
Updating giteaRepositoryUrl: https://gite.slm-lab.net/alma/repo-name
|
|
Updating leantimeProjectId: 123
|
|
Mission updated successfully
|
|
```
|
|
|
|
**Database**:
|
|
```
|
|
giteaRepositoryUrl: "https://gite.slm-lab.net/alma/repo-name"
|
|
leantimeProjectId: "123"
|
|
outlineCollectionId: "collection-456"
|
|
rocketChatChannelId: "channel-789"
|
|
```
|
|
|
|
**Mission Deletion**:
|
|
```
|
|
hasRepoName: true ✅
|
|
leantimeProjectId: 123 ✅
|
|
documentationCollectionId: "collection-456" ✅
|
|
rocketchatChannelId: "channel-789" ✅
|
|
```
|
|
|
|
### Actual (From Your Logs)
|
|
|
|
**Mission Deletion**:
|
|
```
|
|
hasRepoName: false ❌ (Mission created before fix)
|
|
```
|
|
|
|
---
|
|
|
|
## 🎯 Action Required
|
|
|
|
**Create a NEW mission** and check:
|
|
|
|
1. **Server logs** during creation - should show "Mission Created Webhook Received"
|
|
2. **Database** after creation - should have integration IDs
|
|
3. **Deletion logs** - should show non-empty IDs
|
|
|
|
If the new mission has IDs saved, then the fix is working! ✅
|
|
|
|
If not, we need to check:
|
|
- N8N workflow configuration
|
|
- N8N execution logs
|
|
- Server logs for errors
|
|
|
|
---
|
|
|
|
**Document Created**: $(date)
|
|
**Status**: Waiting for verification that new missions have IDs saved
|
|
|