diff --git a/README.md b/README.md index 119dcc2..cad595e 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,6 @@ cp lib/keys.dart.example lib/keys.dart ## Roadmap ### Needed Bugfixes -- Old nodes are sticking around after edit submissions go through, at least in simulate mode. I think we prune those from cache when in production mode at least? - Ask for location permission on first launch, temp disable notification permission - Make submission guide scarier - Tile cache trimming? Does fluttermap handle? diff --git a/lib/state/upload_queue_state.dart b/lib/state/upload_queue_state.dart index e71ff48..05caa11 100644 --- a/lib/state/upload_queue_state.dart +++ b/lib/state/upload_queue_state.dart @@ -533,8 +533,14 @@ class UploadQueueState extends ChangeNotifier { debugPrint('[UploadQueue] Simulating node operation (no real API call)'); await Future.delayed(const Duration(milliseconds: 500)); // Simulate network delay - // Store simulated node ID and move to changeset close phase - item.submittedNodeId = DateTime.now().millisecondsSinceEpoch; + // Store appropriate simulated node ID based on operation type + if (item.operation == UploadOperation.modify) { + // For edits, keep the original node ID (same as production behavior) + item.submittedNodeId = item.originalNodeId!; + } else { + // For creates and extracts, generate new simulated ID + item.submittedNodeId = DateTime.now().millisecondsSinceEpoch; + } item.markNodeOperationComplete(); _saveQueue(); notifyListeners(); @@ -668,7 +674,9 @@ class UploadQueueState extends ChangeNotifier { debugPrint('[UploadQueue] Simulated deletion, removing fake node ID: $simulatedNodeId from cache'); _handleSuccessfulDeletion(item); } else { - debugPrint('[UploadQueue] Simulated upload, fake node ID: $simulatedNodeId'); + debugPrint('[UploadQueue] Simulated upload successful, updating cache with fake node ID: $simulatedNodeId'); + // Update cache with simulated node ID, same as production mode + _updateCacheWithRealNodeId(item, simulatedNodeId); } }