Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .husky/pre-push
100644 → 100755
Empty file.
99 changes: 72 additions & 27 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "world-monitor",
"private": true,
"version": "2.5.8",
"version": "2.5.9",
"license": "AGPL-3.0-only",
"type": "module",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions server/worldmonitor/news/v1/summarize-article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export async function summarizeArticle(
.replace(/<reflection>[\s\S]*?<\/reflection>/gi, '')
.trim();

// Strip unterminated thinking blocks (no closing tag)
rawContent = rawContent
.replace(/<think>[\s\S]*/gi, '')
.replace(/<\|thinking\|>[\s\S]*/gi, '')
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "world-monitor"
version = "2.5.8"
version = "2.5.9"
description = "World Monitor desktop application"
authors = ["World Monitor"]
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schema.tauri.app/config/2",
"productName": "World Monitor",
"mainBinaryName": "world-monitor",
"version": "2.5.8",
"version": "2.5.9",
"identifier": "app.worldmonitor.desktop",
"build": {
"beforeDevCommand": "npm run build:sidecar-sebuf && npm run dev",
Expand Down
2 changes: 1 addition & 1 deletion src/components/TradePolicyPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class TradePolicyPanel extends Panel {
return `<div class="economic-empty">${t('components.tradePolicy.noTariffData')}</div>`;
}

const rows = this.tariffsData.datapoints.map(d =>
const rows = [...this.tariffsData.datapoints].sort((a, b) => b.year - a.year).map(d =>
`<tr>
<td>${d.year}</td>
<td>${d.tariffRate.toFixed(1)}%</td>
Expand Down
18 changes: 8 additions & 10 deletions tests/ttl-acled-ais-guards.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ describe('ACLED shared cache layer', () => {
'Cache key should include event types, start date, end date');
});

it('checks Redis cache before upstream API call', () => {
const cacheCheckIdx = src.indexOf('getCachedJson(cacheKey)');
const fetchIdx = src.indexOf('fetch(`${ACLED_API_URL}');
assert.ok(cacheCheckIdx > -1, 'Should check Redis cache');
assert.ok(fetchIdx > -1, 'Should call ACLED API');
assert.ok(cacheCheckIdx < fetchIdx,
'Cache check should come before upstream fetch');
it('uses cachedFetchJson to check Redis cache before upstream API call', () => {
assert.match(src, /cachedFetchJson\s*<.*>\s*\(cacheKey/,
'Should use cachedFetchJson which handles cache check + coalescing');
assert.ok(src.includes('fetch(`${ACLED_API_URL}'),
'Should call ACLED API inside the fetcher');
});

it('uses 15-minute cache TTL', () => {
Expand All @@ -71,9 +69,9 @@ describe('ACLED shared cache layer', () => {
'Should gracefully degrade when ACLED_ACCESS_TOKEN is not set');
});

it('writes to cache on successful fetch', () => {
assert.match(src, /setCachedJson\(cacheKey, events, ACLED_CACHE_TTL\)/,
'Should cache successful results');
it('caches successful results via cachedFetchJson', () => {
assert.match(src, /cachedFetchJson/,
'Should use cachedFetchJson which writes to cache automatically on successful fetch');
});

it('caches empty successful responses to avoid repeated cache misses', () => {
Expand Down