vrtmrz / obsidian-livesync

MIT License
3.96k stars 134 forks source link

Data from couchDB comes in base64 format #337

Closed talkenson closed 7 months ago

talkenson commented 7 months ago

Abstract

When setting up secondary device, data returned from server is base64 encoded So it's very unusable on mobile

Expected behaviour

Actually happened

Reproducing procedure

  1. Configure LiveSync's second device
  2. Wait until end
  3. Restart (also it's optional) obsidian
  4. Open any note

Note: It fixes by itself when I'm updating via livesync preset, with file opened

Report from the LiveSync

----remote config----
cors:
  credentials: "true"
  headers: accept, authorization, content-type, origin, referer
  max_age: "3600"
  methods: GET,PUT,POST,HEAD,DELETE
  origins: app://obsidian.md, capacitor://localhost, http://localhost
chttpd:
  bind_address: any
  enable_cors: "true"
  max_http_request_size: "4294967296"
  port: "5984"
  require_valid_user: "true"
admins: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
vendor:
  name: The Apache Software Foundation
feature_flags:
  partitioned||*: "true"
chttpd_auth:
  authentication_redirect: /_utils/session.html
  hash_algorithms: sha256, sha
  require_valid_user: "true"
indexers:
  couch_mrview: "true"
prometheus:
  additional_port: "false"
  bind_address: 127.0.0.1
  port: "17986"
httpd:
  WWW-Authenticate: Basic realm="couchdb"
  bind_address: 0.0.0.0
  port: "5986"
smoosh:
  state_dir: ./data
couch_httpd_auth:
  authentication_db: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
  secret: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
  authentication_redirect: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
couchdb_engines:
  couch: couch_bt_engine
couchdb:
  database_dir: ./data
  max_document_size: "50000000"
  single_node: "true"
  uuid: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
  view_index_dir: ./data

---- Plug-in config ---
version:0.21.1
couchDB_URI: self-hosted
couchDB_USER: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
couchDB_PASSWORD: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
couchDB_DBNAME: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
liveSync: false
syncOnSave: false
syncOnStart: false
savingDelay: 200
lessInformationInLog: false
gcDelay: 0
versionUpFlash: ""
minimumChunkSize: 20
longLineThreshold: 250
showVerboseLog: false
suspendFileWatching: false
trashInsteadDelete: true
periodicReplication: false
periodicReplicationInterval: 60
syncOnFileOpen: false
encrypt: false
passphrase: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
usePathObfuscation: false
doNotDeleteFolder: false
resolveConflictsByNewerFile: false
batchSave: false
deviceAndVaultName: ""
usePluginSettings: false
showOwnPlugins: false
showStatusOnEditor: true
usePluginSync: true
autoSweepPlugins: false
autoSweepPluginsPeriodic: false
notifyPluginOrSettingUpdated: false
checkIntegrityOnSave: false
batch_size: 50
batches_limit: 40
useHistory: true
disableRequestURI: true
skipOlderFilesOnSync: true
checkConflictOnlyOnOpen: false
syncInternalFiles: false
syncInternalFilesBeforeReplication: false
syncInternalFilesIgnorePatterns: \/node_modules\/, \/\.git\/, \/obsidian-livesync\/
syncInternalFilesInterval: 60
additionalSuffixOfDatabaseName: ""
ignoreVersionCheck: false
lastReadUpdates: 0
deleteMetadataOfDeletedFiles: false
syncIgnoreRegEx: ""
syncOnlyRegEx: ""
customChunkSize: 100
readChunksOnline: true
watchInternalFileChanges: true
automaticallyDeleteMetadataOfDeletedFiles: 0
disableMarkdownAutoMerge: false
writeDocumentsIfConflicted: false
useDynamicIterationCount: false
syncAfterMerge: false
configPassphraseStore: ""
encryptedPassphrase: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
encryptedCouchDBConnection: ๐‘…๐ธ๐ท๐ด๐ถ๐‘‡๐ธ๐ท
permitEmptyPassphrase: false
useIndexedDBAdapter: true
useTimeouts: false
writeLogToTheFile: false
doNotPaceReplication: false
hashCacheMaxCount: 300
hashCacheMaxAmount: 50
concurrencyOfReadChunksOnline: 100
minimumIntervalOfReadChunksOnline: 333
hashAlg: xxhash64
suspendParseReplicationResult: false
doNotSuspendOnFetching: false
useIgnoreFiles: false
ignoreFiles: .gitignore
syncOnEditorSave: false
pluginSyncExtendedSetting: {}

Plug-in log

We can see the log by tapping the Document box icon. If you noticed something suspicious, please let me know. Note: Please enable Verbose Log. For detail, refer to Logging, please.

Plug-in log ``` Home vault:11/25/2023, 6:07:50 PM->Replication closed Home vault:11/25/2023, 6:07:51 PM->Scanning hidden files. Home vault:11/25/2023, 6:07:51 PM->Hidden files scanned: 1 files had been modified Home vault:11/25/2023, 6:07:51 PM->Before LiveSync, start OneShot once... Home vault:11/25/2023, 6:07:51 PM->OneShot Sync begin... (pullOnly) Home vault:11/25/2023, 6:07:51 PM->Replication activated Home vault:11/25/2023, 6:07:51 PM->Replication completed Home vault:11/25/2023, 6:07:51 PM->LiveSync begin... Home vault:11/25/2023, 6:07:52 PM->Content saved:.obsidian/workspace-mobile.json ,chunks: 1 (new:1, skip:0, cache:0) Home vault:11/25/2023, 6:07:52 PM->Replication activated Home vault:11/25/2023, 6:07:52 PM->STORAGE --> DB:.obsidian/workspace-mobile.json: (hidden) Done Home vault:11/25/2023, 6:07:54 PM->Content saved:.obsidian/workspace-mobile.json ,chunks: 1 (new:1, skip:0, cache:0) Home vault:11/25/2023, 6:07:54 PM->Replication activated Home vault:11/25/2023, 6:07:54 PM->STORAGE --> DB:.obsidian/workspace-mobile.json: (hidden) Done ```

It is okay

Screenshots

telegram-cloud-photo-size-2-5409136895994221200-y

ikenhe commented 7 months ago

Same here with the latest plugin version

blogj commented 7 months ago

Mobile or base64 format ็‰ˆๆœฌไธบ 0.21.2 Screenshot_2023-11-27-16-07-11-185_md obsidian

blogj commented 7 months ago

ๅฎž้™…ไธŠ่ฟ™ๆ˜ฏๅทฒ็ป็ ดๅไบ†ๆบๆ–‡ไปถ ๏ผŒๆˆ‘้‡ๆ–ฐๅฏผๅ…ฅjoplinๅฏผๅ‡บ็š„mdๆ–‡ไปถ่งฃๅ†ณ

vrtmrz commented 7 months ago

Thank you for your report! And, I am really sorry for this! This problem has been caused by a bug of v0.21.1! Probably it has been fixed at v0.21.2. However, once encoded, the note will not be decoded automatically. Fortunately, these note has been just only encoded. We can decode it. If you have a Linux device, you can decode it by cat xxx.md | base64 --decode. Or you can use this online tool (This web app; previously I made -- will not send any information to the server, you can use it within your browser).

I hope that your problems are solved in v0.21.2. Sorry for your inconvenience!

talkenson commented 7 months ago

@vrtmrz it is okay for me, i've just enabled the "live sync" preset, and added a newline on every note (while it was opened on my mobile)

Thank you for quick response! Gonna tell friend who faced this issue too

blogj commented 7 months ago

ๆˆ‘ๆ˜ฏๆ›ดๆ–ฐไบ†็‰ˆๆœฌ๏ผŒ็„ถๅŽๅ†ๆŠŠๆบๆ–‡ไปถmd้‡ๆ–ฐไปŽๅฏผๅ‡บๆฅไธ€้่งฃๅ†ณ็š„

vrtmrz commented 7 months ago

Thank you for you all for the confirmation! Now we can close this issue. I really appreciate your contribution!