Skip to content
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

Uncategorized view #682

Closed
bavay opened this issue Apr 11, 2019 · 15 comments
Closed

Uncategorized view #682

bavay opened this issue Apr 11, 2019 · 15 comments
Labels
Projects

Comments

@bavay
Copy link

bavay commented Apr 11, 2019

With Nextcloud 15.0.7 (and the latest version of the bookmarks app), the "all" and "uncategorized" views contain exactly the same, although I have some bookmarks that I've moved to subfolders (and most of my bookmarks have tags).

As I understand it, only bookmarks that don't belong to a subfolder should end up in "uncategorized".

@marcelklehr
Copy link
Member

marcelklehr commented Apr 14, 2019

Hey, I sadly cannot reproduce this. Can you check the client side javascript console logs and the nextcloud logs for errors?

@bavay
Copy link
Author

bavay commented Apr 17, 2019

Hi! here are my nextcloud logs. I have quite a few error messages, even for the default view. I have replaced my user name and IP by placeholders, just in case you'd wonder...
nextcloud.log

@marcelklehr marcelklehr added this to Backlog in Bookmarks Apr 22, 2019
@marcelklehr
Copy link
Member

Those errors are unrelated, as far as I can tell. Could you open the client-side javascript console and check the log? Usually that's the F12 key.

@marcelklehr marcelklehr moved this from Backlog to In Progress in Bookmarks Apr 22, 2019
@bavay
Copy link
Author

bavay commented Apr 24, 2019

When loading the default view, this is what I get:

Content Security Policy: Directive ‘child-src’ has been deprecated. Please use directive ‘worker-src’ to control workers, or directive ‘frame-src’ to control frames respectively.
JQMIGRATE: Migrate is installed, version 1.4.0 core.js:7:542
New search handler registered search.js:67:4
Loaded script with known vulnerabilities: https://XXXX/core/vendor/core.js?v=0fd94d96-21

After clicking on "Uncategorized", I don't get any other logs... Could the fetch error be the problem?

@marcelklehr
Copy link
Member

Source map error: TypeError: NetworkError when attempting to fetch resource.

This is unlikely to be the problem.

@marcelklehr
Copy link
Member

Could you send me a database dump of the oc_bookmarks_folders_bookmarks table?

@Vantome
Copy link

Vantome commented Apr 26, 2019

I have the same problem with the categories.

I did some digging in the database and some testing. Whenever I "move" a bookmark via the web ui from a folder wether from the folder ungategorized with id -1 or an self created folder then the bookmark entry doesn't change in the table oc_bookmarks_folder_bookmarks. Insted of changig an second entry will be added with the same bookmark_id but different folder_id.

So when i repeatedly "move" a bookmark via the web ui I end up with the same amount of entries for a particular bookmark in the table oc_bookmark_folder_bookmarks. Insted of moving I dublicate the bookmark folder entry.

I hope this description is helpful.

@marcelklehr
Copy link
Member

This is exactly what I suspected. I cannot reproduce this off-hand, though. Which browser are you using?

@bavay
Copy link
Author

bavay commented Apr 26, 2019

Sorry, I did not provide my db dump (debugging some things on my server, making it totally unusable). On my side, I am using Firefox 66.0.3 on Linux.

@Vantome
Copy link

Vantome commented Apr 26, 2019

I have this beavior with Firefox 66.0.3 and Chrome 74.0.3729.108 on Windows 10 as well as with Safari 12.1 and Firefox 66.0.3 on macOS Mojave.

@jpumc
Copy link

jpumc commented May 2, 2019

Hi.

I also have this problem, and inspected it a little and found some things which I added as comments below.

  • In js/apps/MainRouter.js:32

     		folder: function(folderId) {
     			this.app.bookmarks.setFetchQuery({ folder: folderId }); // folderId is a string coming from the router
     			this.app.bookmarks.fetchPage();
     			Radio.channel('nav').trigger('navigate', 'folder', folderId);
     		},
  • In js/models/Bookmarks.js:21

     	setFetchQuery: function(data) {
     		this.loadingState.set({
     			page: 0,
     			query: data, // data is { folder: "<folder id>" }
     			fetching: false,
     			reachedEnd: false
     		});
     		this.abortCurrentRequest();
     	},
  • In js/views/Folder.js:231

     	moveBookmark: function(bm) {
     		var that = this;
     		var folders = bm.get('folders'), // this is a list of numbers
     			isInsideFolder =
     				'undefined' !==
     				typeof this.app.bookmarks.loadingState.get('query').folder; // the string set in setFetchQuery
     		if (isInsideFolder) {
     			if (
     				this.app.bookmarks.loadingState.get('query').folder === // same as above
     				this.model.get('id') // returns a number
     			) {
     				return;
     			}
     			folders = _.without(
     				folders, // the list of numbers from above
     				this.app.bookmarks.loadingState.get('query').folder // again, a string
     			);
     		}
     		folders.push(this.model.get('id'));
     		bm.set('folders', folders);
     		if (isInsideFolder) {
     			bm.once('sync', function() {
     				that.app.bookmarks.remove(bm);
     			});
     		}
     		bm.save();
     },

By changing the line

this.app.bookmarks.setFetchQuery({ folder: folderId });

to

this.app.bookmarks.setFetchQuery({ folder: Number(folderId) });

it seems to work, but I don't know if it might affect other things.

@marcelklehr
Copy link
Member

marcelklehr commented May 2, 2019

aha. I've seen an incarnation of this problem before. You're running postgres?

@jpumc Thanks for taking the time to debug this! 💙

@marcelklehr
Copy link
Member

Fixed by 426a355

Bookmarks automation moved this from In Progress to Done May 2, 2019
@jpmv27
Copy link

jpmv27 commented Jul 5, 2019

@marcelklehr
I am using Bookmarks 1.0.6 (which contains the commit 426a355) with NextCloud 16.0.2 and I still see this issue. I am also using PG.

@marcelklehr marcelklehr reopened this Jul 5, 2019
Bookmarks automation moved this from Done to Backlog Jul 5, 2019
@jpmv27
Copy link

jpmv27 commented Jul 5, 2019

@marcelklehr
I did not realize that the fix does not work retroactively.
I manually reclassified all my bookmarks into their same categories/folders and now everything is working as expected.
Sorry for the noise.
And thanks for the fix!

Bookmarks automation moved this from Backlog to Done Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

5 participants