From 107a836fd41a88377759946761a7e89f9cf39102 Mon Sep 17 00:00:00 2001 From: Patrick Luby Date: Thu, 18 Jul 2024 19:02:08 -0400 Subject: [PATCH] Fix failure to load documents in iOS app The iOS app (and presumably the Android app) do not have jails. Instead, they read and write files directly from the user's local file system. Also, running the iOS in trace mode is nearly unusable so move the key "To JS" and "To Online" iOS messages to LOG_DBG and run the app with "debug" instead of "trace" by default. Signed-off-by: Patrick Luby Change-Id: Ic8aabc09b297b15207be49c0e674e8006bcaa367 --- ios/Mobile.xcodeproj/xcshareddata/xcschemes/Mobile.xcscheme | 2 +- ios/Mobile/CODocument.mm | 2 +- ios/Mobile/DocumentViewController.mm | 2 +- wsd/DocumentBroker.cpp | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ios/Mobile.xcodeproj/xcshareddata/xcschemes/Mobile.xcscheme b/ios/Mobile.xcodeproj/xcshareddata/xcschemes/Mobile.xcscheme index 0d4c81ad9..2d8b1c979 100644 --- a/ios/Mobile.xcodeproj/xcshareddata/xcschemes/Mobile.xcscheme +++ b/ios/Mobile.xcodeproj/xcshareddata/xcschemes/Mobile.xcscheme @@ -53,7 +53,7 @@ diff --git a/ios/Mobile/CODocument.mm b/ios/Mobile/CODocument.mm index f9dcbc1ea..4ffffeb10 100644 --- a/ios/Mobile/CODocument.mm +++ b/ios/Mobile/CODocument.mm @@ -101,7 +101,7 @@ static std::atomic appDocIdCounter(1); } - (void)send2JS:(const char *)buffer length:(int)length { - LOG_TRC("To JS: " << COOLProtocol::getAbbreviatedMessage(buffer, length).c_str()); + LOG_DBG("To JS: " << COOLProtocol::getAbbreviatedMessage(buffer, length).c_str()); const unsigned char *ubufp = (const unsigned char *)buffer; std::vector data; diff --git a/ios/Mobile/DocumentViewController.mm b/ios/Mobile/DocumentViewController.mm index 140f9db1f..c6011edeb 100644 --- a/ios/Mobile/DocumentViewController.mm +++ b/ios/Mobile/DocumentViewController.mm @@ -302,7 +302,7 @@ static IMP standardImpOfInputAccessoryView = nil; if (subBody.length < ((NSString*)message.body).length) subBody = [subBody stringByAppendingString:@"..."]; - LOG_TRC("To Online: " << [subBody UTF8String]); + LOG_DBG("To Online: " << [subBody UTF8String]); #if 0 static int n = 0; diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 73ea810d3..e3c52b966 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -2873,8 +2873,12 @@ bool DocumentBroker::sendUnoSave(const std::shared_ptr& session, std::string DocumentBroker::getJailRoot() const { +#if !MOBILEAPP assert(!_jailId.empty()); return Poco::Path(COOLWSD::ChildRoot, _jailId).toString(); +#else + return std::string(); +#endif } std::size_t DocumentBroker::addSession(const std::shared_ptr& session,