Repository navigation
fix(sync): clarify network-known transactions #1002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2594,7 +2594,7 @@ | |
| "Rebroadcast" = "Rebroadcast"; | ||
|
|
||
| /* Delete a never-accepted transaction from local wallet state */ | ||
| "Remove if not on Blockchain" = "Remove if not on Blockchain"; | ||
| "Remove if Not on Network" = "Remove if Not on Network"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
keys=(
"Remove if Not on Network"
"Transaction is known to the network"
"A block explorer reports that this transaction is known to the Dash network."
"The wallet first checks a block explorer."
)
status=0
while IFS= read -r file; do
for key in "${keys[@]}"; do
if ! rg -q -F -- "$key" "$file"; then
printf 'Missing key in %s: %s\n' "$file" "$key"
status=1
fi
done
done < <(fd -t f 'Localizable\.strings$' .)
for key in "${keys[@]}"; do
rg -n -F --glob '*.swift' --glob 'Localizable.strings' -- "$key" . || {
printf 'No source/catalog reference found: %s\n' "$key"
status=1
}
done
exit "$status"Repository: dashpay/dashwallet-ios Length of output: 213 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- localization files ---'
git ls-files '*Localizable.strings'
echo '--- exact key occurrences ---'
for key in \
'Remove if Not on Network' \
'Transaction is known to the network' \
'A block explorer reports that this transaction is known to the Dash network.' \
'The wallet first checks a block explorer.'
do
printf '\nKEY: %s\n' "$key"
rg -n -F --glob '*.swift' --glob '*Localizable.strings' -- "$key" . || true
done
echo '--- candidate localization/transifex configuration ---'
git ls-files | rg -i 'transifex|localiz|translation|strings' | head -200
echo '--- target file encoding ---'
python3 - <<'PY'
from pathlib import Path
p = Path('DashWallet/en.lproj/Localizable.strings')
b = p.read_bytes()
print('exists:', p.exists())
print('size:', len(b))
print('UTF-8 BOM:', b.startswith(b'\xef\xbb\xbf'))
try:
b.decode('utf-8')
print('UTF-8 decode: ok')
except UnicodeDecodeError as e:
print('UTF-8 decode: failed:', e)
PYRepository: dashpay/dashwallet-ios Length of output: 11310 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- changed English entries ---'
git diff --unified=3 -- DashWallet/en.lproj/Localizable.strings | sed -n '1,220p'
echo '--- old/new phrase coverage ---'
for phrase in \
'Remove if Not on Network' \
'Remove if Not in Blockchain' \
'Transaction is known to the network' \
'Transaction is in the mempool' \
'A block explorer reports that this transaction is known to the Dash network.' \
'A block explorer reports that this transaction is not in the blockchain.' \
'The wallet first checks a block explorer.'
do
printf '\nPHRASE: %s\n' "$phrase"
rg -n -F --glob '*Localizable.strings' --glob '*.swift' -- "$phrase" . || true
done
echo '--- root source context ---'
rg -n -F \
-e 'Remove if Not on Network' \
-e 'Remove if Not in Blockchain' \
-e 'Transaction is known to the network' \
-e 'Transaction is in the mempool' \
-e 'A block explorer reports' \
-e 'The wallet first checks a block explorer' \
Localizable.strings || true
echo '--- localization metadata/configuration ---'
git ls-files -a | rg -i '(^|/)(\.tx|transifex|translation|localization|localizable|strings)' | tail -120Repository: dashpay/dashwallet-ios Length of output: 6523 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
targets = [
"Remove if Not on Network",
"Transaction is known to the network",
"A block explorer reports that this transaction is known to the Dash network. It may still be waiting in the mempool or may already be included in a block, so it wasn't removed. The wallet will update its confirmation automatically once it is included in a synchronized block.",
"The wallet first checks a block explorer. A transaction known to the network — whether it is waiting in the mempool or already included in a block — is never removed. If the transaction isn't found, it is deleted from this wallet on this device, and the coins it was trying to spend become available again. The wallet then rescans recent blocks as a safety check. Nothing is sent to the network.",
]
files = sorted(Path(".").glob("**/Localizable.strings"))
for f in files:
text = f.read_text(encoding="utf-8-sig")
present = [k in text for k in targets]
print(f"{f}: {sum(present)}/{len(targets)}", present)
print("\nRoot source summary:")
root = Path("Localizable.strings")
if root.exists():
print("lines:", len(root.read_text(encoding="utf-8-sig").splitlines()))
print(root.read_text(encoding="utf-8-sig")[:500])
else:
print("missing")
PY
echo '--- localization-related tracked files ---'
git ls-files | rg -i '(^|/)(\.tx|transifex|translation|localization|localizable|strings)' | tail -160
echo '--- conversion script ---'
script=$(find . -type f -name 'convert_strings_to_utf8.sh' -print -quit)
if [ -n "$script" ]; then
cat -n "$script"
fiRepository: dashpay/dashwallet-ios Length of output: 3875 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- patch commit summary ---'
git log -1 --oneline
git diff --stat HEAD^ HEAD -- DashWallet/en.lproj/Localizable.strings
git diff --unified=2 HEAD^ HEAD -- DashWallet/en.lproj/Localizable.strings | sed -n '1,240p'
echo '--- decode root Localizable.strings ---'
python3 - <<'PY'
from pathlib import Path
p = Path("Localizable.strings")
b = p.read_bytes()
print("BOM bytes:", b[:4].hex())
for enc in ("utf-16", "utf-16-le", "utf-16-be", "utf-8"):
try:
text = b.decode(enc)
except UnicodeDecodeError:
continue
print("decoded as:", enc, "lines:", len(text.splitlines()))
for i, line in enumerate(text.splitlines(), 1):
if any(term in line for term in (
"Remove if Not",
"Transaction is known",
"Transaction is in the mempool",
"block explorer",
)):
print(f"{i}:{line}")
PY
echo '--- tracked and untracked Transifex-related paths ---'
find . -maxdepth 4 -type f \( -iname '*transifex*' -o -name '.tx' -o -name '*.po' \) -print
git ls-files | rg -i 'transifex|(^|/)\.tx($|/)|\.po$' || trueRepository: dashpay/dashwallet-ios Length of output: 4144 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '--- Transifex configuration ---'
cat -n .tx/config
echo '--- root Localizable.strings key coverage ---'
python3 - <<'PY'
from pathlib import Path
keys = [
"Remove if not on Blockchain",
"Remove if Not on Network",
"Transaction is on the blockchain",
"Transaction is known to the network",
"A block explorer reports this transaction on the Dash network, so it wasn't removed. The wallet will catch up with its confirmation on its own.",
"A block explorer reports that this transaction is known to the Dash network. It may still be waiting in the mempool or may already be included in a block, so it wasn't removed. The wallet will update its confirmation automatically once it is included in a synchronized block.",
"The wallet first checks a block explorer — a transaction that is on the blockchain is never removed. If it isn't found, the transaction is deleted from this wallet on this device and the coins it was trying to spend become available again. The wallet then rescans recent blocks, so if the transaction does turn out to be on the blockchain, it comes back on its own. Nothing is sent to the network.",
"The wallet first checks a block explorer. A transaction known to the network — whether it is waiting in the mempool or already included in a block — is never removed. If the transaction isn't found, it is deleted from this wallet on this device, and the coins it was trying to spend become available again. The wallet then rescans recent blocks as a safety check. Nothing is sent to the network.",
]
p = Path("Localizable.strings")
text = p.read_bytes().decode("utf-16")
for key in keys:
print(("present" if key in text else "missing") + ": " + key)
PYRepository: dashpay/dashwallet-ios Length of output: 3098 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
key_re = re.compile(r'^\s*"((?:\\.|[^"])*)"\s*=')
new_keys = {
"Remove if Not on Network",
"Transaction is known to the network",
"A block explorer reports that this transaction is known to the Dash network. It may still be waiting in the mempool or may already be included in a block, so it wasn't removed. The wallet will update its confirmation automatically once it is included in a synchronized block.",
"The wallet first checks a block explorer. A transaction known to the network — whether it is waiting in the mempool or already included in a block — is never removed. If the transaction isn't found, it is deleted from this wallet on this device, and the coins it was trying to spend become available again. The wallet then rescans recent blocks as a safety check. Nothing is sent to the network.",
}
sample_keys = [
"Select block explorer",
"Remove if not on Blockchain",
"Transaction is on the blockchain",
]
for p in sorted(Path("DashWallet").glob("*.lproj/Localizable.strings")):
raw = p.read_bytes()
text = raw.decode("utf-8-sig")
keys = set(m.group(1) for line in text.splitlines() if (m := key_re.match(line)))
print(f"{p}: entries={len(keys)} new={len(keys & new_keys)} samples={[k in keys for k in sample_keys]}")
PYRepository: dashpay/dashwallet-ios Length of output: 4007 Sync the renamed keys with Transifex and the non-English catalogs.
🤖 Prompt for AI AgentsSource: Learnings |
||
|
|
||
| /* Remove never-accepted transaction: confirmation title */ | ||
| "Remove this transaction?" = "Remove this transaction?"; | ||
|
|
@@ -2630,10 +2630,10 @@ | |
| "Removing the listing is a network transaction with a small fee, paid from your identity balance. You keep the name." = "Removing the listing is a network transaction with a small fee, paid from your identity balance. You keep the name."; | ||
|
|
||
| /* Remove never-accepted transaction: refused because the explorer found it */ | ||
| "Transaction is on the blockchain" = "Transaction is on the blockchain"; | ||
| "Transaction is known to the network" = "Transaction is known to the network"; | ||
|
|
||
| /* Remove never-accepted transaction: refusal body */ | ||
| "A block explorer reports this transaction on the Dash network, so it wasn't removed. The wallet will catch up with its confirmation on its own." = "A block explorer reports this transaction on the Dash network, so it wasn't removed. The wallet will catch up with its confirmation on its own."; | ||
| "A block explorer reports that this transaction is known to the Dash network. It may still be waiting in the mempool or may already be included in a block, so it wasn't removed. The wallet will update its confirmation automatically once it is included in a synchronized block." = "A block explorer reports that this transaction is known to the Dash network. It may still be waiting in the mempool or may already be included in a block, so it wasn't removed. The wallet will update its confirmation automatically once it is included in a synchronized block."; | ||
|
|
||
| /* Remove never-accepted transaction: success */ | ||
| "Transaction removed" = "Transaction removed"; | ||
|
|
@@ -2642,7 +2642,7 @@ | |
| "Transaction removed — rescan couldn't start, run Rescan Filters in Core Sync Status" = "Transaction removed — rescan couldn't start, run Rescan Filters in Core Sync Status"; | ||
|
|
||
| /* Remove never-accepted transaction: confirmation body */ | ||
| "The wallet first checks a block explorer — a transaction that is on the blockchain is never removed. If it isn't found, the transaction is deleted from this wallet on this device and the coins it was trying to spend become available again. The wallet then rescans recent blocks, so if the transaction does turn out to be on the blockchain, it comes back on its own. Nothing is sent to the network." = "The wallet first checks a block explorer — a transaction that is on the blockchain is never removed. If it isn't found, the transaction is deleted from this wallet on this device and the coins it was trying to spend become available again. The wallet then rescans recent blocks, so if the transaction does turn out to be on the blockchain, it comes back on its own. Nothing is sent to the network."; | ||
| "The wallet first checks a block explorer. A transaction known to the network — whether it is waiting in the mempool or already included in a block — is never removed. If the transaction isn't found, it is deleted from this wallet on this device, and the coins it was trying to spend become available again. The wallet then rescans recent blocks as a safety check. Nothing is sent to the network." = "The wallet first checks a block explorer. A transaction known to the network — whether it is waiting in the mempool or already included in a block — is never removed. If the transaction isn't found, it is deleted from this wallet on this device, and the coins it was trying to spend become available again. The wallet then rescans recent blocks as a safety check. Nothing is sent to the network."; | ||
|
|
||
| /* Remove never-accepted transaction: failure title */ | ||
| "Couldn't remove the transaction" = "Couldn't remove the transaction"; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use network terminology consistently in explorer verification failures. The unavailable-verification path still says the transaction “isn't on the blockchain,” but this check cannot establish absence from the network, including mempool entries. Update the related localized failure strings to use “isn't known to the network” and “verify whether the transaction is known to the network,” so the refusal contract matches the network-level check.
📍 Affects 2 files
DashWallet/Sources/Infrastructure/SwiftDashSDK/UnconfirmedTransactionRemover.swift#L75-L75(this comment)DashWallet/en.lproj/Localizable.strings#L2633-L2636🤖 Prompt for AI Agents