nextcloud / ocsms

📱 Nextcloud/ownCloud PhoneSync server application
https://play.google.com/store/apps/details?id=fr.unix_experience.owncloud_sms
GNU Affero General Public License v3.0
189 stars 52 forks source link

Incompatible with NC 20 #323

Closed Valdnet closed 3 years ago

Valdnet commented 4 years ago

Phone Sync is not compatible with Nextcloud 20.

NOTE: There is a 1.10.1 version for Nextcloud 20 in Nextcloud Apps, which probably shouldn't be. When downloading, it redirects to a strange address. Firefox warns about the threat.

schniepp commented 4 years ago

Can the title of this be changed to "Incompatible with NC 20"? This might work better to get the developers' attention.

Also, how serious is this problem with the weird link? Is this potentially leading to a compromised package? To me, this sounds quite scary. Should this be brought to someone's attention? Again, that's something that's not reflected in the title.

e-alfred commented 4 years ago

This strange release pops up all the time if a new Nextcloud version is added to the app store. I have opened an issue there: https://github.com/nextcloud/appstore/issues/774

The app works with Nextcloud 20, but we have to make a release and @nerzhul has to publish it to the App Store.

Valdnet commented 4 years ago

The app works with Nextcloud 20,

@e-alfred The application does not work properly with the NC20. When loading SMS messages for a given phone number, only the charging animation is shown.

e-alfred commented 4 years ago

@valdnet Do get any error messages if you try to load your SMS messages?

Valdnet commented 4 years ago

@e-alfred I am not getting any error log messages.

schniepp commented 4 years ago

@e-alfred : thx for filing that bug report. Pointing a package to a weird link sounded serious enough.

fkocik commented 4 years ago

Hi, I have same issue here : conversation loading not working since upgrade to NC 20.0.1.

Observing Network in Firefox WebConsole shows that requests is correctly sent to /index.php/apps/ocsms/front-api/v1/conversation?phoneNumber=... and got a valid 200/OK answer with populated JSON stream. Yet, at the same time, this error appears in the console :

$ is deprecated: The global jQuery is deprecated. It will be updated to v3.x in Nextcloud 21. In later versions of Nextcloud it might be removed completely. Please ship your own. globals.js:60:15
Uncaught ReferenceError: escapeHTML is not defined
    formatConversation app.min.js:1
    each jQuery
    formatConversation app.min.js:1
    fetch app.min.js:1
    jQuery 8
    fetch app.min.js:1
    loadConversation app.min.js:1
    VueJS 3
app.min.js:1:7922
    formatConversation app.min.js:1
    each jQuery
    formatConversation app.min.js:1
    formatConversation self-hosted:1161
    fetch app.min.js:1
    jQuery 8
    fetch app.min.js:1
    fetch self-hosted:1161
    loadConversation app.min.js:1
    loadConversation self-hosted:1161
    VueJS 3

Hoping that can help. Regards.

adi2k5 commented 4 years ago

For me it's the same behaviour, trying to load conversation, but nothing is being shown. But today I got hit with some error, maybe this is somehow related

[PHP] Error: Error: call_user_func() expects parameter 1 to be a valid callback, class 'OCA\OcSms\Db\Config' not found at /var/www/nextcloud/lib/public/AppFramework/Db/Mapper.php#326 at <<closure>>

 0. <<closure>>
    OC\Log\ErrorHandler::onError(2, "call_user_func( ... d", "/var/www/nextcl ... p", 326, {row: {key: "notification_state"}})
 1. /var/www/nextcloud/lib/public/AppFramework/Db/Mapper.php line 326
    call_user_func("OCA\\OcSms\\Db\\Config::fromRow", {key: "notification_state"})
 2. /var/www/nextcloud/lib/public/AppFramework/Db/Mapper.php line 369
    OCP\AppFramework\Db\Mapper->mapRowToEntity({key: "notification_state"})
 3. /var/www/nextcloud/apps/ocsms/db/configmapper.php line 56
    OCP\AppFramework\Db\Mapper->findEntity("SELECT `key` FR ... ?", ["notification_state","***"])
 4. /var/www/nextcloud/apps/ocsms/db/configmapper.php line 44
    OCA\OcSms\Db\ConfigMapper->hasKey("notification_state", "6f3774e9277ebe4 ... 2")
 5. /var/www/nextcloud/apps/ocsms/controller/settingscontroller.php line 83
    OCA\OcSms\Db\ConfigMapper->set("notification_state", "6f3774e9277ebe4 ... 2")
 6. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 169
    OCA\OcSms\Controller\SettingsController->setNotificationState("1")
 7. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 100
    OC\AppFramework\Http\Dispatcher->executeController(OCA\OcSms\Contro ... {}, "setNotificationState")
 8. /var/www/nextcloud/lib/private/AppFramework/App.php line 152
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\OcSms\Contro ... {}, "setNotificationState")
 9. /var/www/nextcloud/lib/private/Route/Router.php line 308
    OC\AppFramework\App::main("SettingsController", "setNotificationState", OC\AppFramework\ ... {}, {action: null,_r ... "})
10. /var/www/nextcloud/lib/base.php line 1008
    OC\Route\Router->match("/apps/ocsms/set/notification_state")
11. /var/www/nextcloud/index.php line 37
    OC::handleRequest()

POST /index.php/apps/ocsms/set/notification_state
MrSpecialR commented 3 years ago

I had the exact same issue - the SMS messages do not load on my install of NC 20. Seems like the issue is with the escapeHTML function not being defined in the browser.

Uncaught ReferenceError: escapeHTML is not defined
    at Object.<anonymous> (app.min.js?v=def7abd1-0:formatted:323)
    at Function.each (jquery.js:371)
    at hn.formatConversation (app.min.js?v=def7abd1-0:formatted:316)
    at Object.success (app.min.js?v=def7abd1-0:formatted:280)
    at l (jquery.js:3187)
    at Object.fireWith [as resolveWith] (jquery.js:3317)
    at M (jquery.js:8757)
    at XMLHttpRequest.<anonymous> (jquery.js:9123)

The messages started to appear after I manually defined a JS function in the Chrome debugger named escapeHTML that just returns the passed parameter. Obviously this is just a temporary fix and not safe, but it shows that it's just missing a basic function.

After a bit of looking - the escapeHTML is invoked only in the js/app.min.js when displaying each individual SMS message. So the easiest solution would be adding an implementation if the function is not defined.

I also noticed that the function is defined in /index.php/js/activity/activity-sidebar.js, which for some reason is not requested when loading the Phone Sync page, but is available for use in the Nextcloud Dashboard, Nextcloud Photos and some other pages.

e-alfred commented 3 years ago

It happens because the escapeHTML library isn't shipped by Nextcloud itself anymore. We have to ship our own to keep the app running. I made some new commits, can you try to build the app and see if it works?

e-alfred commented 3 years ago

Fixed by the new release 2.1.9: https://github.com/nextcloud/ocsms/releases/tag/2.1.9

@nerzhul Please add this release to the Nextcloud app store.