# SQM_Update_102 Delivery Package

## Update Overview

**Version:** 1.0.2-alpha (Update Ordinal 102)  
**Type:** Patch (Bug Fix)  
**Release Date:** 2026-04-15  

## What's Fixed

### SSI Include Path Resolution Issue
- **Problem:** Server-side includes (`<!--#include file="/Content/..."-->`) were not resolving correctly in production
- **Solution:** Replaced SSI directives with inline ASP.NET server-side code and proper portal-relative paths
- **Impact:** Favicon declarations and browsehappy HTML rendering now work reliably

## Files Changed

| File | Changes |
|------|---------|
| `Web/App_MasterPages/layout.Master` | Removed SSI includes; added inline favicon markup with `~/` portal-relative paths; inline browsehappy browser upgrade notice |

## Deployment Method

### PowerShell Ordination Script
**File:** `Updates/SQM_Update_102.ps1`

The script implements six phases:

1. **Phase 1:** Prerequisite validation
2. **Phase 2:** Backup current production files
3. **Phase 3:** Deploy updated files with ordination copies (`.102` suffix)
4. **Phase 4:** Hash verification of deployed files
5. **Phase 5:** Update version tracking files
6. **Phase 6:** Display summary and rollback instructions

### Ordination System Benefits

- ✅ **Audit Trail:** Each change creates a timestamped ordination folder
- ✅ **Versioned Copies:** Original files preserved as `filename.ext.101`, `filename.ext.102`, etc.
- ✅ **Hash Verification:** SHA256 checksums confirm deployment integrity
- ✅ **Automated Backup:** Complete pre-deployment snapshots saved
- ✅ **Rollback Ready:** Single command restoration available

## Deployment Instructions

### Dry-Run (Recommended First Step)
```powershell
cd C:\___Work\SqliteMojo\Updates
powershell -File .\SQM_Update_102.ps1 -DryRun
```

### Live Deployment
```powershell
cd C:\___Work\SqliteMojo\Updates
powershell -File .\SQM_Update_102.ps1
```

### Rollback (If Needed)
```powershell
Copy-Item -Path "C:\___Fire\SqliteMojo\Backups\SQM_Update_102_yyyyMMdd_HHmmss\*" -Destination "C:\___Fire\SqliteMojo\Web" -Recurse -Force
```
(Replace timestamp with actual backup folder timestamp)

## Verification Steps

After deployment, verify:

```powershell
# Check ordination copies created
Get-ChildItem "C:\___Fire\SqliteMojo\Web\Updates\Ordinations" -Filter "*.102"

# View deployment log
Get-Content "C:\___Fire\SqliteMojo\Web\Updates\SQM_Update_102_Log.txt"

# Verify layout.Master renders without errors
# Open portal and check for any console errors in browser dev tools
```

## Version Tracking

The update script automatically:
- Updates `Web/VERSION.md` with new version `1.0.2-alpha`
- Adds entry to `Web/Updates/VERSION_HISTORY.md`
- Creates detailed deployment log at `Web/Updates/SQM_Update_102_Log.txt`

## Technical Details

### Path Resolution Fix

**Before (SSI - Problematic):**
```html
<!--#include file="/Content/failsafeskin/includes/favicons.html"-->
```

**After (ASP.NET Relative - Resolved):**
```html
<link rel="icon" href="~/favicon.ico" />
<link rel="apple-touch-icon" href="~/apple-touch-icon.png" />
```

The `~/` syntax automatically resolves to the mojoPortal application root, ensuring paths work correctly regardless of URL routing configuration.

### Inline Browsehappy Notice

**Before (SSI):**
```html
<!--#include file="/Content/failsafeskin/includes/browsehappy.html"-->
```

**After (ASP.NET Server-Side):**
```html
<noscript>
    <div class="browsehappy">
        <p><%= Resources.Resource.BrowserUpgradeNotice ?? "You are using an outdated browser..." %></p>
    </div>
</noscript>
```

This approach:
- Uses proper ASP.NET server-side expression syntax
- Respects mojoPortal's localization resource system
- Falls back gracefully if resource key not found

## Rollback Strategy

If the update causes issues:

1. **Immediate Rollback:** Use the rollback command provided at deployment completion
2. **Ordination History:** All previous versions preserved at `Web/Updates/Ordinations/`
3. **Log Review:** Check deployment log for any warnings or errors

## Build Status

✅ **Build Successful** - All changes compile cleanly under .NET Framework 4.8.1

## Next Steps

After successful deployment of 102:

- Monitor production for any rendering issues
- Confirm favicons and browser upgrade notices display correctly
- Document any environmental-specific path considerations
- Proceed with Phase 2 migration engine implementation (multi-app rotator support)

---

**Package Created:** 2026-04-15  
**Script Syntax:** Validated ✅  
**Ready for Deployment:** Yes ✅
